Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Action: Add format.yml workflow #30604

Merged
merged 24 commits into from
Sep 21, 2023

Conversation

bnchrch
Copy link
Contributor

@bnchrch bnchrch commented Sep 20, 2023

Problem(s)

  1. Our formatters live in a large and hard to grok workflow
  2. Our formatters are not always applied
  3. We do not consistently check or autocommit formatting changes

Short term solution

  1. Break out our call to the gradle format task into a separate file
  2. That runs format on all branches
  3. and autocommits their changes

closes #27675

Long terms solution

Theres enough going on here that I want to propose a longer change

Working on a document explaining that now: https://docs.google.com/document/d/1X8KVmomXT5EwiNuwyvO5oQGMTMrZbt1nyBxWsSpDEo8/edit

@bnchrch bnchrch requested review from a team as code owners September 20, 2023 01:59
@bnchrch bnchrch requested a review from a team September 20, 2023 01:59
@vercel
Copy link

vercel bot commented Sep 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Sep 21, 2023 10:44pm

@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@bnchrch bnchrch requested review from a team, evantahler and postamar September 20, 2023 01:59
Copy link
Contributor

@postamar postamar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Originally I was worried that having this workflow run concurrently to that in gradle.yml would lead to all kinds of problems due to this pushing a commit and therefore invalidating the other, but now I realize that gradle.yml has routinely been failing and that that doesn't seem to be causing any trouble.

Copy link
Contributor Author

bnchrch commented Sep 21, 2023

I had this same concern. So far it seeems fine. I think its mostly due to that github doesnt trigger further actions on automated commits.

Copy link
Contributor Author

bnchrch commented Sep 21, 2023

Just waiting for some green checks to get this in.

If im wrong Im sure I will find out very quickly

@bnchrch
Copy link
Contributor Author

bnchrch commented Sep 21, 2023

Ran into an issue where

  1. Autocommit doesnt trigger new CI actions
  2. Without new ci actions run, the required status checks are never reported because the latest commit doesnt match the commit the required check was run on

Very known issue: https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs

Solution

  1. Use PAT token to commit to trigger ci actions after format
  2. Update important CI actions to cancel if duplicate in progress
  3. Ensure that one connector test pipeline runs at a time for PRs but unlimited for workflow runs.

Thought:
This will extend test times, if its an issue it indicates that we should move auto format to

  1. A commit hook
  2. and an auto commit only on master.

@bnchrch
Copy link
Contributor Author

bnchrch commented Sep 21, 2023

Still plan on merging once gradle related tests pass. I cancelled Connector tests as they are redundant.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ bnchrch
❌ octavia-approvington
You have signed the CLA already but the status is still pending? Let us recheck it.

@airbyte-oss-build-runner
Copy link
Collaborator

destination-duckdb test report (commit a3b189fe97) - ❌

⏲️ Total pipeline duration: 02mn06s

Step Result
Connector package install
Build destination-duckdb docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests
Code format checks
Validate airbyte-integrations/connectors/destination-duckdb/metadata.yaml
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-duckdb test

@airbyte-oss-build-runner
Copy link
Collaborator

source-apify-dataset test report (commit a3b189fe97) - ✅

⏲️ Total pipeline duration: 02mn30s

Step Result
Connector package install
Build source-apify-dataset docker image for platform linux/x86_64
Acceptance tests
Code format checks
Validate airbyte-integrations/connectors/source-apify-dataset/metadata.yaml
Connector version semver check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-apify-dataset test

@postamar
Copy link
Contributor

This all makes sense, SGTM. :shipit:

@bnchrch
Copy link
Contributor Author

bnchrch commented Sep 21, 2023

/approve-and-merge reason="format changes"

@octavia-approvington
Copy link
Contributor

Myomoto says it looks good
thats a niiice

@octavia-approvington octavia-approvington merged commit 5d82789 into master Sep 21, 2023
@octavia-approvington octavia-approvington deleted the bnchrch/fix/broken-format branch September 21, 2023 23:11
jbfbell pushed a commit that referenced this pull request Sep 22, 2023
Co-authored-by: bnchrch <[email protected]>
Co-authored-by: octavia-approvington <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment