AZ 219 remove git force push to main#165
AZ 219 remove git force push to main#165KazyCC wants to merge 22 commits intoCardinal-Cryptography:mainfrom
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Still some minor gripes. ^^"
| if [ -f publishMe ]; then | ||
| cargo publish | ||
| fi | ||
| echo 'Uploading to crates.io' |
There was a problem hiding this comment.
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.
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.
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.
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: