-
Notifications
You must be signed in to change notification settings - Fork 330
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
Conversation
00408a5
to
698c963
Compare
698c963
to
219bb68
Compare
219bb68
to
afb7ea7
Compare
afb7ea7
to
baad2a1
Compare
3d70071
to
f30ad60
Compare
* add body and text to github release for unitctl Signed-off-by: Ava Hahn <[email protected]>
f30ad60
to
dd93edc
Compare
Can we clear this up once and for all!? |
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? |
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 ( 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:
Does that seem like a correct assessment? Is there something I'm missing? (e.g., can we delete the tag after making the release?) |
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.
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
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). |
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 |
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... |
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?) |
Good point! bit of a chicken & the egg problem... |
On Thu, 16 May 2024 16:18:14 -0700 avahahn ***@***.***> wrote:
> From some initial searching, it looks like a [tag is required](https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release) for published releases and prereleases, but it may be possible to ship a [draft release](https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release) without actually creating a tag in the repo (draft: true in the [release-action parameters](https://github.com/ncipollo/release-action)) until that draft is published.
Did you not see the linked example releases? The manual release is not done with any kind of tag.
We do not need to worry about this.
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
$ git show 999.1.2-thebeesknees
commit 30b39bd (tag: 999.999.999-yeehaw, tag: 999.1.2-thebeesknees, tag: 19.19.19-testing123, tag: 1.999.999-2, tag: 1.33.2-test, tag: 1.22.44-test3)
Author: Andrew Clayton ***@***.***>
Date: Fri Apr 19 19:09:59 2024 +0100
Add GitHub workflows for extra coverage
So things are not entirely clear to me.
Did _you_ create that tag to trigger a release?
But from your PR message
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
"manual trigger" as opposed to "tag trigger" would indicate not.
Or was it just a tag you created so there was a tag associated with the
release?
Perhaps you could give a description of how this process actually works?
|
It was made automatically by the release action it seems
Heres the code: https://github.com/ncipollo/release-action/tree/main/src |
@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 |
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. |
Can that be created as a lightweight tag so it doesn't interfere with the likes of git-describe(1)? |
If your observation is correct, then this it is in fact created as a lightweight tag. |
To be honest I'm too uneasy with this whole concept that it wouldn't be appropriate for me to approve this... |
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.
Only explains what's already in the codebase, no functional changes happen here
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 |
Manually running the workflow does not create annotated tags, so 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) |
Note: I would've expected the created tag to be |
What's the .a mean? and do we need unitctl in there twice? |
That's just me entering an arbitrary name during testing. |
On Thu, 20 Jun 2024 04:56:57 -0700 Dan Callahan ***@***.***> wrote:
Manually running the workflow does _not_ create annotated tags, so `git describe` is unaffected.
Here's a full shell session showing how things work
```console
$ 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 57a0f94 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)
Yes, it created a lightweight tag
$ git show 1.32.0-unitctl.a
commit 57a0f94 (tag: 1.32.0-unitctl.b, tag: 1.32.0-unitctl.a)
Author: Ava Hahn ***@***.***>
Date: Tue Jun 18 23:06:05 2024 -0700
tools/unitctl: unitctl export
* new subcommand for "export" in CLI
* new cmd submodule for exporting config tarballs
* logic to also output to stdout
* README additions
* limitations documented
Signed-off-by: Ava Hahn ***@***.***>
As it's a direct reference to the commit and not a tag object...
|
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