Skip to content

Conversation

@kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Jul 1, 2021

Otherwise, there is no easy way to ignore this error and allow the CI to progress when triggering the same set-commit command with no new commits. Simple || true is not sufficient, as it will silent all possible valid errors.

Q: Not sure if we should call it --allow-empty or --ignore-empty to be consistent with newly added ignore-missing flag.

@kamilogorek kamilogorek changed the title feat: Add --ignore-empty flag that will not bail command when no patchset is created feat: Add --allow-empty flag that will not bail command when no patchset is created Jul 1, 2021
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Think we should use ignore-empty


if commits.is_empty() {
bail!("No commits found. Leaving release alone.");
// NOTE: Make it a default behavior on next major release instead?
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we explicitly say TODO(v2): so it's easier to grep? Then we can make a decision on what we wanna do when we think about the next major bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link

@codingjoe codingjoe Jul 12, 2021

Choose a reason for hiding this comment

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

I don't know if that is a good idea. A release could consist of configuration changes through your environment. In those cases, I still want to have a release on Sentry. This could be a very common use case for everyone using the 12 factor app approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted. Thanks for the feedback!

will create a release with the default commits count (or the one specified with `--initial-depth`) \
instead of failing the command."))
.arg(Arg::with_name("allow-empty")
.long("allow-empty")
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if allow-empty is the correct phrase to use here since --allow-empty in git adds commits with no content in them. In this case, this option refers to the fact that there is no commits to add to a release - I'm sure someone will get this confused when they try and use the allow-empty option in it's current state.

Maybe we should use ignore-empty. It won't conflict with git's --allow-empty (which may prevent future user misunderstandings), and ignore matches what is happening better than allow (updating the release is ignored).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid reasoning. Changed

@kamilogorek kamilogorek enabled auto-merge (squash) July 5, 2021 12:13
@kamilogorek kamilogorek disabled auto-merge July 5, 2021 12:13
@kamilogorek kamilogorek changed the title feat: Add --allow-empty flag that will not bail command when no patchset is created feat: Add --ignore-empty flag that will not bail command when no patchset is created Jul 5, 2021
@kamilogorek kamilogorek enabled auto-merge (squash) July 5, 2021 12:13
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
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