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

An empty release (no issues) should lead to a draft instead of a release error #495

Closed
davidzwa opened this issue Jun 16, 2023 · 7 comments · Fixed by #615
Closed

An empty release (no issues) should lead to a draft instead of a release error #495

davidzwa opened this issue Jun 16, 2023 · 7 comments · Fixed by #615
Assignees
Labels
Milestone

Comments

@davidzwa
Copy link

davidzwa commented Jun 16, 2023

Detailed Description

I currently experience trouble releasing releases that carry no issues. In my PoV GRM should not decide that this is not allowed. The same holds for non-existing milestones.

Context

In my opinion GRM should simply be a passthrough for existing Github actions that create a release (f.e. the archived action https://github.com/actions/create-release/releases). If things are not according to what GRM was designed for (no issues, only excluded issues, no milestone), it would be lovely if the tool could still create the release but in draft mode.

My scenario: I have expensive 1 hour builds that fail due to misconfigured github labels. I tried to mitigate a lot, but I've come to the conclusion that without the strictness on GRM's end I would not have to wait for long builds/releases to complete to be presented with a release creation error. (This is not a rant, purely describing my situation)

Possible Implementation

We could simply toggle createDraftNoIssues, ignoreNoIssues ignoreNoMilestone. We could also add a warning text to the release body "No issues were closed for milestone/release x.y.z".
Alternatively we could easily add mutually exclusive configuration options that allow users to choose.

Your Environment

  • Version Used:
  • Edition Used: .NET Core (Github Actions, git-actions dist)
  • Operating System and version: Ubuntu 20.04
@davidzwa davidzwa changed the title An empty release (no issues) should lead to a draft instead of a release error An empty release (no issues) should lead to a draft instead of a release error - configurable Jun 16, 2023
@gep13
Copy link
Member

gep13 commented Jun 19, 2023

Hmm, this is an interesting idea. When we first started GitReleaseManager it was intended as a very opinionated tool which would fail if the repository wasn't in the "correct" state in order for release generation to happen.

Looking back, I can see that it might be been setup to be too aggressive. I don't think I would be against the idea of relaxing these restrictions through configuration options though.

I am curious though... if you are not at a release point, i.e. there aren't any closed issues, why are you running GitReleaseManager? For example, when I am ready to run it, I normally use something like the application of a tag to trigger the execution. Curious what you workflow looks like.

@davidzwa
Copy link
Author

Hmm, this is an interesting idea. When we first started GitReleaseManager it was intended as a very opinionated tool which would fail if the repository wasn't in the "correct" state in order for release generation to happen.

Looking back, I can see that it might be been setup to be too aggressive. I don't think I would be against the idea of relaxing these restrictions through configuration options though.

Im glad to hear that. I propose to make the default very tolerant or respecting the user's mistakes or learning curve, and making 'fail fast mode' to be configurable if they so desire. I do see the point for some scenarios.

I am curious though... if you are not at a release point, i.e. there aren't any closed issues, why are you running GitReleaseManager? For example, when I am ready to run it, I normally use something like the application of a tag to trigger the execution. Curious what you workflow looks like.

I agree that sometimes 'fail fast' is better than 'fail silently'. In this case my workflow is different: my releases contain so little change that an issue is not justified. You could call it lazy as well, but in some cases I want to automate it.
In my case the releases are automated or nightlies which have no issues attached and the content of the release is a big payload that needs to be attached to a release (otherwise the users cannot easily download it).

Relevant repo - a custom Raspberry Pi image for deploying my project:
https://github.com/fdm-monster/MonsterPi
Currently I'm manually adding the attachments to a release.

@Jericho
Copy link
Contributor

Jericho commented Jul 30, 2024

How about a configuration setting that would allow developers to specify if they want to allow milestones without issues.

  • When this setting is set to false (which would be the default value), the current behavior is preserved. Meaning: we throw a InvalidOperationException when we detect that the milestone is not associated with any issues.
  • When this setting is true and the milestone does not have any associated issues, the release is created.

I'll submit a PR with this new Boolean setting.

Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Jul 30, 2024
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Feb 1, 2025
@gep13
Copy link
Member

gep13 commented Feb 20, 2025

@Jericho I think this is a good start, and adding the configuration option to allow the creation of an empty release makes sense.

When I had originally thought about this issue, I had envisioned a new empty release template, which would give the user the option to control the contents of the empty release wording. The default, would be something along the lines of:

This release had no issues associated with it

What are your thoughts on this?

Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Feb 20, 2025
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Feb 20, 2025
@Jericho
Copy link
Contributor

Jericho commented Feb 20, 2025

Sure no problem. One quick note though:

The current GRM logic determines which template will be used BEFORE any data is fetched from GitHub/GitLab which means that we don't know whether there are any issues associated with the milestone. This logic is in VcsService.CreateReleaseFromMilestoneAsync. The data is fetched in ReleaseNotesBuilder.BuildReleaseNotesAsync.

All this to say that, in order to implement your suggestion, I will have to move the "template choosing" logic from VcsService.CreateReleaseFromMilestoneAsync to ReleaseNotesBuilder.BuildReleaseNotesAsync.

Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Feb 20, 2025
…e any associated issues AND the developer has indicated they want to allow milestones without issues.
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Feb 20, 2025
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Feb 21, 2025
@gep13 gep13 linked a pull request Feb 21, 2025 that will close this issue
@gep13
Copy link
Member

gep13 commented Feb 21, 2025

@Jericho said...
All this to say that, in order to implement your suggestion, I will have to move the "template choosing" logic from VcsService.CreateReleaseFromMilestoneAsync to ReleaseNotesBuilder.BuildReleaseNotesAsync.

I don't think I have any objections to this happening. Will review the PR when I have some time.

@gep13 gep13 added this to the 0.20.0 milestone Feb 21, 2025
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
…e any associated issues AND the developer has indicated they want to allow milestones without issues.
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
…any associated issues AND the developer has indicated they want to allow milestones without issues.
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Mar 25, 2025
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
…e any associated issues AND the developer has indicated they want to allow milestones without issues.
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
Jericho added a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
This commit introduces a new configuration value in the
GitReleaseManager.yaml file, which is disabled by default.  When
enabled, it will be used to control whether the creation of an "empty"
release is allowed.  This will make use of a new "empty" Scriban
template, which will be introduced in the next commit.
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
When creating a release a new template is used when a milestone does not
have any associated issues AND the developer has indicated they want to
allow milestones without issues.

The decision on which template to use has had to be moved.  It can still
be overridden when required, but the calculated value is based on how
many issues have been found, whether to include contributors, etc.
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
Due to the change to allow calculation of which template to use, it is
no longer needed to pass in a template value.  This is only needed when
we specifically want/need to control which template is used.
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
When creating a release a new template is used when a milestone does not
have any associated issues AND the developer has indicated they want to
allow milestones without issues.

The decision on which template to use has had to be moved.  It can still
be overridden when required, but the calculated value is based on how
many issues have been found, whether to include contributors, etc.
gep13 pushed a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
Due to the change to allow calculation of which template to use, it is
no longer needed to pass in a template value.  This is only needed when
we specifically want/need to control which template is used.
gep13 added a commit to Jericho/GitReleaseManager that referenced this issue Apr 3, 2025
Add information to the docs section for the new
allow-milestone-without-issues option.
gep13 added a commit that referenced this issue Apr 3, 2025
@gep13 gep13 closed this as completed in #615 Apr 3, 2025
gep13 pushed a commit that referenced this issue Apr 3, 2025
Merge pull request #615 from Jericho/allow_milestone_without_issues

(#495) Allow milestones without issues
@gep13 gep13 changed the title An empty release (no issues) should lead to a draft instead of a release error - configurable An empty release (no issues) should lead to a draft instead of a release error Apr 3, 2025
gep13 added a commit that referenced this issue Apr 3, 2025
* release/0.20.0:
  Bump NGitLab from 7.6.0 to 8.3.0 in /src
  Bump Scriban from 5.12.1 to 6.1.0 in /src
  Bump GraphQL.Client from 6.0.1 to 6.1.0 in /src
  Bump GraphQL.Client.Serializer.SystemTextJson in /src
  Bump Microsoft.Extensions.DependencyInjection in /src
  Bump the analyzers group across 1 directory with 2 updates
  (#495) Add docs for new configuration option
  (#495) Fix tests as a result of changes
  (#495) Make use of new empty Scriban template
  (#495) Allow milestones without issues
  (build) Further prevent running documentation
  (build) Disable Wyam documentation
  (#669) Remove support for .NET 6.0 and 7.0
  (#690) Add support for .NET 8.0 and 9.0
  bring back the TargetFrameworks as it's required by Cake.Receipe
  move common project properties to Directory.Build.props
@gittools-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.20.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants