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

Test centralized GitHub actions config #112

Merged
merged 59 commits into from
Apr 22, 2024

Conversation

wagnerlmichael
Copy link
Member

@wagnerlmichael wagnerlmichael commented Mar 26, 2024

Dual PR with ccao-data/actions#22.

This PR factors out a number of steps in the pre-commit workflow.

@wagnerlmichael wagnerlmichael marked this pull request as ready for review April 16, 2024 21:15
Copy link
Collaborator

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

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

I really like this interface, and I think it's 95% there, with a remaining open question around the way that local pre-commit should be handled. I think this could come in immediately if need be, but am curious to hear what Dan thinks about the local pre-commit issue first!

.github/workflows/pre-commit.yaml Outdated Show resolved Hide resolved
.github/workflows/pre-commit.yaml Outdated Show resolved Hide resolved
.gitignore Outdated
@@ -2,8 +2,10 @@ venv/
__pycache__/
ipynb_checkpoints
glue/schema/*.parquet
.pre-commit-config.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Thought, non-blocking] After thinking about it for a bit, I think that I actually prefer the other side of the tradeoff described in the PR body: It strikes me as slightly friendlier to keep a local copy of the pre-commit config under version control, in spite of the duplication with the ccao-data/actions/pre-commit action, so that developers can run pre-commit locally with minimal overhead. Having to occasionally resolve conflicts between the local pre-commit config and the remote config in ccao-data/actions/pre-commit will sometimes be annoying, but I expect it will be a less common annoyance than requiring every developer to copy the remote config to their local repo before they start development (and then also update their local copy whenever the remote changes).

That being said, this is a weakly-held opinion; what do you two think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with the sentiment. A question for me is: Given that we would include both in each repository, how valuable is it to transition to composite actions across all of our repositories? It doesn't seem clear to me that we would be significantly reducing lines of code or reducing the total number of files.

What would positives from this be? I suppose we can have a single source of truth for which to look for all of our hook versions in the actions repo, and that at least upon PRs they are all standardized. Maybe this would be a good start for other actions functionalities I'm not aware of.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good point, there's definitely a tradeoff between DRY and developer experience here. I'm comfortable moving forward with the gitignore and just making sure we explain to the rest of the team how they'll be expected to manage local pre-commit configs going forward.

Copy link
Member

Choose a reason for hiding this comment

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

See my response on the actions PR

.gitignore Outdated Show resolved Hide resolved
Co-authored-by: Jean Cochrane <[email protected]>
Copy link
Member

@dfsnow dfsnow left a comment

Choose a reason for hiding this comment

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

See corresponding Actions PR

run: pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash
- name: Run pre-commit checks
uses: ccao-data/actions/pre-commit@create-composite-pre-commit-action
Copy link
Member Author

Choose a reason for hiding this comment

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

Eventually this branch name will be subbed for main when we merge.

Copy link
Collaborator

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

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

Awesome 👏🏻

Copy link
Member

@dfsnow dfsnow left a comment

Choose a reason for hiding this comment

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

👍

@wagnerlmichael wagnerlmichael merged commit 12b4dc3 into main Apr 22, 2024
2 checks passed
@wagnerlmichael wagnerlmichael deleted the Test-centralized-github-actions-config branch April 22, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants