Skip to content

Conversation

@KazyCC
Copy link

@KazyCC KazyCC commented Dec 15, 2021

Changes:

  1. in push-foundation-repo.yml automatic publish to crates.io will be disabled for now.
  2. removed force-push
  3. version is updating on PR branch, not main
  4. new version is established before completing the PR

@github-actions
Copy link

github-actions bot commented Dec 15, 2021

Please make sure the following happened

  • Appropriate tests created
  • Infrastructure updated accordingly
  • Updated existing documentation
  • New documentation created
  • Version bumped if breaking changes

@KazyCC
Copy link
Author

KazyCC commented Dec 15, 2021

It looks like there is an issue with permissions - https://github.com/Cardinal-Cryptography/AlephBFT/actions/runs/1583186193? @bartoszjedrzejewski could you assist?

Copy link
Contributor

@timorl timorl left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented code.

Copy link
Author

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.

Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

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'
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

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?

Copy link
Author

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:

  1. On PR creation to main -> prepare-version-bump.yml
  2. Manually (for now) -> version-bump.yml
  3. On (2) -> push-foundation-repo.yml.

Copy link
Contributor

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
Copy link
Contributor

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'
Copy link
Contributor

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?

Copy link
Contributor

@timorl timorl left a 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'
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

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: |
Copy link
Contributor

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.

@Marcin-Radecki
Copy link
Contributor

I am closing this PR on behalf we've incorporated its inputs in #168 .

Thanks for work on this :)

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.

4 participants