-
Notifications
You must be signed in to change notification settings - Fork 50
AZ 219 remove git force push to main #165
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
AZ 219 remove git force push to main #165
Conversation
…s: 1) "prepare-new-version" triggereed on PR (open, reopen, synchronize); 2) "autobump" publishing new version to crates.io during push into main.
|
Please make sure the following happened
|
|
It looks like there is an issue with permissions - https://github.com/Cardinal-Cryptography/AlephBFT/actions/runs/1583186193? @bartoszjedrzejewski could you assist? |
timorl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple nits, some naming confusion and one question. Looks nice in general!
| # workflows: ["Autobump version"] | ||
| # branches: [main] | ||
| # types: | ||
| # - completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By purpose - see note above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why we have git though – if someone wants to see what once was here they can use history. Commented code is just confusing too often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about history - commented code is left there, because it is the right code to be enabled in the future, when workflows stabilize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but keeping commented code is always confusing. I would rather trust the person who will enable the automation here to do this correctly. If they need help one of the options is to look in the history, that's what I meant by it staying there.
| if [ -f publishMe ]; then | ||
| cargo publish | ||
| fi | ||
| echo 'Uploading to crates.io' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, I'm confused now, this always pushes to crates.io?
Anyway, you probably want to rename this file? It seems there was some naming confusion here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow is invoked right now only manually, so yes, if you invoke it manually, it will publish every time it will be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, although maybe it's just my lack of understanding of workflows – this file seems to imply it will always run on push to main, the other file states it only runs manually. And the other one also publishes. Shouldn't this file just be deleted then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I did some clean up. See 4339e93. Workflow should be like this:
- On PR creation to main -> prepare-version-bump.yml
- Manually (for now) -> version-bump.yml
- On (2) -> push-foundation-repo.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems good now. I still have some gripes with naming – maybe call this one something like "Publish to crates.io" rather than "Autobump version"? Similar for file names, what is now called "prepare-..." should just be "version-bump" and this one "publish" or something.
| # workflows: ["Autobump version"] | ||
| # branches: [main] | ||
| # types: | ||
| # - completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why we have git though – if someone wants to see what once was here they can use history. Commented code is just confusing too often.
| if [ -f publishMe ]; then | ||
| cargo publish | ||
| fi | ||
| echo 'Uploading to crates.io' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, although maybe it's just my lack of understanding of workflows – this file seems to imply it will always run on push to main, the other file states it only runs manually. And the other one also publishes. Shouldn't this file just be deleted then?
timorl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some minor gripes. ^^"
| if [ -f publishMe ]; then | ||
| cargo publish | ||
| fi | ||
| echo 'Uploading to crates.io' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems good now. I still have some gripes with naming – maybe call this one something like "Publish to crates.io" rather than "Autobump version"? Similar for file names, what is now called "prepare-..." should just be "version-bump" and this one "publish" or something.
| # workflows: ["Autobump version"] | ||
| # branches: [main] | ||
| # types: | ||
| # - completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but keeping commented code is always confusing. I would rather trust the person who will enable the automation here to do this correctly. If they need help one of the options is to look in the history, that's what I meant by it staying there.
| @@ -1,4 +1,4 @@ | |||
| name: Sync Cardinal-Cryptography repo with Aleph-Zero-Foundation repo | |||
| name: Sync Cardinal-Cryptography repo with Aleph-Zero-Foundation repo. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: All the other names don't have punctuation, please make this consistent (whichever way you prefer).
| ref: ${{ github.head_ref }} | ||
| token: ${{ secrets.SYNCAZF || secrets.MY_TOKEN || github.token }} | ||
| - name: check-and-bump | ||
| run: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this block can be made into sh script (and put somewhere in the scripts/... folder). This way it will be more readable here and easier to review the script without the noise from the workflow file.
|
I am closing this PR on behalf we've incorporated its inputs in #168 . Thanks for work on this :) |
Changes: