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

differentiate unitctl releases #1265

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

avahahn
Copy link
Contributor

@avahahn avahahn commented May 15, 2024

  • title of release is modified to read "unitctl-..."
  • body text added to elaborate that this is only a release for unitctl
  • explanation added for where users can find releases of Unit itself

Example release:
manual trigger: https://github.com/avahahn/unit/releases/tag/999.1.2-thebeesknees
tag trigger: https://github.com/avahahn/unit/releases/tag/9.9.10

ac000
ac000 previously approved these changes May 15, 2024
@ac000 ac000 dismissed their stale review May 15, 2024 20:48

Unresolved question about tagging.

@avahahn avahahn requested review from ac000 and callahad May 15, 2024 22:27
@avahahn avahahn force-pushed the ci-cli-release-text branch 3 times, most recently from 3d70071 to f30ad60 Compare May 15, 2024 22:58
* add body and text to github release for unitctl

Signed-off-by: Ava Hahn <[email protected]>
ac000
ac000 previously approved these changes May 16, 2024
@ac000 ac000 dismissed their stale review May 16, 2024 02:55

Still confusion abounds

@ac000
Copy link
Member

ac000 commented May 16, 2024

Can we clear this up once and for all!?

nginx/homebrew-unit#39 (comment)

@callahad
Copy link
Collaborator

Perhaps more explicitly: it looks like your test fork is creating tags for manual runs of the workflow. Is it possible to do a GitHub release without making a tag?

@callahad
Copy link
Collaborator

From some initial searching, it looks like a tag is required for published releases and prereleases, but it may be possible to ship a draft release without actually creating a tag in the repo (draft: true in the release-action parameters) until that draft is published.

It's not clear to me who is able to see draft releases.

If I'm grokking correctly, it seems like our options for pushing artifacts outside of a full Unit release are:

  1. Use draft releases, but they're likely only visible to repo collaborators, or
  2. Create new tags

Does that seem like a correct assessment?

Is there something I'm missing? (e.g., can we delete the tag after making the release?)

@ac000
Copy link
Member

ac000 commented May 16, 2024

Hmm, it does seem that way...

I thought it worked the other way around, i.e a release would be triggered on a tag being pushed.

Is there something I'm missing? (e.g., can we delete the tag after making the release?)

Creating and deleting a tag could be OK, especially if it's a lightweight tag. However the main issue there would be that you'd be stuck trying to checkout that version from git, if for example you wanted to attempt a reproducible build or any of a myriad of other reasons.

However having stumbled across

I believe that creating a release from the GitHub web UI also triggers a tag push, as long as the tag didn't already exist.

Perhaps that's the way to go... doing that after a Unit version tag is pushed shouldn't result in any new tag (or tag update).

@callahad
Copy link
Collaborator

I thought it worked the other way around, i.e a release would be triggered on a tag being pushed.

The release step also triggers on that case.

  release:
    if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'

So the release step happens whenever we push a tag matching '[0-9]+.[0-9]+.[0-9]+', or when we manually invoke the workflow.

@ac000
Copy link
Member

ac000 commented May 16, 2024

So the release step happens whenever we push a tag matching '[0-9]+.[0-9]+.[0-9]+', or when we manually invoke the workflow.

Yeah, that's what I thought... so if we want to do a manual release now we just 'back date it' to 1.32.0/1 and it shouldn't do any harm...

@callahad
Copy link
Collaborator

Can we backdate it to an existing tag, or would that also try to build with the source as of that tag (and in which unitctl doesn't exist?)

@ac000
Copy link
Member

ac000 commented May 16, 2024

Good point! bit of a chicken & the egg problem...

@ac000
Copy link
Member

ac000 commented May 17, 2024 via email

@avahahn
Copy link
Contributor Author

avahahn commented May 17, 2024

Or was it just a tag you created so there was a tag associated with the
release?

It was made automatically by the release action it seems

Perhaps you could give a description of how this process actually works?

Heres the code: https://github.com/ncipollo/release-action/tree/main/src
I dug as deep as the octokit core library and couldnt find the logical case where this thing is actually generated. I think github is a closed source application.

@avahahn
Copy link
Contributor Author

avahahn commented May 20, 2024

@ac000 @callahad

What is the path forward for this changeset?

@callahad
Copy link
Collaborator

@avahahn The next step is for you to propose what we do about tagging. :)

The original discussions were predicated on being able to generate releases without creating tags. It appears that is not possible per my comment above.

The simplest thing is probably namespacing the tags with a unitctl/ prefix, but I honestly don't care what we decide so long as it's considered and deliberate.

@avahahn
Copy link
Contributor Author

avahahn commented May 21, 2024

@avahahn The next step is for you to propose what we do about tagging. :)

The original discussions were predicated on being able to generate releases without creating tags. It appears that is not possible per #1265 (comment).

The simplest thing is probably namespacing the tags with a unitctl/ prefix, but I honestly don't care what we decide so long as it's considered and deliberate.

I think in this case the most effective thing we can do is to use namespaced tags when we trigger manual releases and try to minimize their use. I think we could use a namespaced tag in the here and now to cut the first release, but then rely on normal tags being pushed to the repo during the release process to cut future github releases.

@ac000
Copy link
Member

ac000 commented May 21, 2024

Can that be created as a lightweight tag so it doesn't interfere with the likes of git-describe(1)?

@avahahn
Copy link
Contributor Author

avahahn commented May 24, 2024

There is certainly some amount of confusion around this...

I see your manually released unitctl and it has a tag of
999.1.2-thebeesknees

I pulled your repository and I see that tag in there as a lightweight
tag. It points to one of my commits

If your observation is correct, then this it is in fact created as a lightweight tag.
Then we can assume that tags created by the action during manual triggers are lightweight

@avahahn avahahn requested a review from ac000 May 28, 2024 20:19
@ac000 ac000 removed their request for review May 29, 2024 21:57
@ac000
Copy link
Member

ac000 commented May 29, 2024

To be honest I'm too uneasy with this whole concept that it wouldn't be appropriate for me to approve this...

Copy link
Contributor

@javorszky javorszky left a comment

Choose a reason for hiding this comment

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

Only explains what's already in the codebase, no functional changes happen here

@callahad
Copy link
Collaborator

callahad commented Jun 17, 2024

Social agreement: Don't manually run the workflow without talking to the team first.

(I'll write down a full characterization of the impact on git describe for manual and automatic runs of the workflow beforehand)

@callahad callahad self-assigned this Jun 17, 2024
@avahahn avahahn merged commit 3501a50 into nginx:master Jun 18, 2024
19 checks passed
@callahad
Copy link
Collaborator

Manually running the workflow does not create annotated tags, so git describe is unaffected.

Here's a full shell session showing how things work

$ gh repo clone callahad/unit-tmp && cd unit-tmp
Cloning into 'unit-tmp'...
remote: Enumerating objects: 20904, done.
remote: Counting objects: 100% (568/568), done.
remote: Compressing objects: 100% (322/322), done.
remote: Total 20904 (delta 271), reused 409 (delta 206), pack-reused 20336
Receiving objects: 100% (20904/20904), 12.24 MiB | 10.06 MiB/s, done.
Resolving deltas: 100% (15444/15444), done.
From github.com:nginx/unit
 * [new branch]        master     -> upstream/master

$ git describe
1.32.0-130-g57a0f94e

$ gh workflow run unitctl -f version=1.32.0-unitctl.a
✓ Created workflow_dispatch event for unitctl.yml at master

To see runs for this workflow, try: gh run list --workflow=unitctl.yml

$ git pull --tags
From github.com:callahad/unit-tmp
 * [new tag]           1.32.0-unitctl.a -> 1.32.0-unitctl.a
Already up to date.

$ git describe
1.32.0-130-g57a0f94e

$ git switch -d 1.32.0-unitctl.a
HEAD is now at 57a0f94e tools/unitctl: unitctl export

$ git describe
1.32.0-130-g57a0f94e

$ echo "foo" >> README.md && git commit -am 'test commit'
[detached HEAD c100a413] test commit
 1 file changed, 1 insertion(+)

$ git describe
1.32.0-131-gc100a413

(cc: @ac000)

@callahad
Copy link
Collaborator

Note: I would've expected the created tag to be unitctl/1.32.0-unitctl.a - that's a bug in this PR. Separate PR coming to address that.

@ac000
Copy link
Member

ac000 commented Jun 20, 2024

What's the .a mean? and do we need unitctl in there twice?

@callahad
Copy link
Collaborator

That's just me entering an arbitrary name during testing.

@ac000
Copy link
Member

ac000 commented Jun 20, 2024 via email

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