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

feat: output URLs to prefilled GitHub release forms when executing melos version #406

Merged
merged 5 commits into from
Oct 17, 2022

Conversation

Almighty-Alpaca
Copy link
Contributor

Description

This PR implements a basic type of GitHub release creation. This is done by generating a URL to the form with prefilled values as query parameters, which is displayed at the end of the melos version command as clickable links. For more info see #277.

The following example was executed right after this commit (on my main branch):

Terminal Output

WindowsTerminal_2022-10-12_22-05-16

Generated Link

Members of this repository can just click the link to try it out, everyone else has to change the URL to their fork first. Nothing is created by opening the link unless you publish or save the release.

https://github.com/melos/melos/releases/new?tag=melos-v2.8.0&title=melos+v2.8.0&body=%23%23+2.8.0%0A%0A+-+%2A%2AFIX%2A%2A%3A+only+include+normal+dependencies+of+transitive+dependencies+%28%5B%23387%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fissues%2F387%29%29.+%28%5Be0659e97%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fcommit%2Fe0659e976ad2d9eef90f611fa012a51e14880657%29%29%0A+-+%2A%2AFIX%2A%2A%3A+return+type+of+%60promptChoice%60+%28%5B%23391%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fissues%2F391%29%29.+%28%5B54004993%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fcommit%2F54004993c980a204533980508bb2c03b27fe45fc%29%29%0A+-+%2A%2AFEAT%2A%2A%3A+Implement+creating+URLs+to+prefilled+GitHub+release+forms+when+executing+%60melos+version%60.+%28%5B1fd990b1%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fcommit%2F1fd990b1cc2c853c906737863f4ad52dfbd47d99%29%29%0A+-+%2A%2AFEAT%2A%2A%3A+add+%60--dependent-preid%60+option+%28%5B%23388%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fissues%2F388%29%29.+%28%5Bb6201364%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fcommit%2Fb6201364dd951db39ab422b6baaa812cef8b83fd%29%29%0A+-+%2A%2ADOCS%2A%2A%3A+add+%60flutter_html%60+to+projects+using+Melos+%28%5B%23389%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fissues%2F389%29%29.+%28%5B4e3a4447%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fcommit%2F4e3a4447b41973eb4b779b096a0dbdfcf2a3188c%29%29%0A+-+%2A%2ADOCS%2A%2A%3A+add+yak_packages+reference+to+docs%2Findex+%28%5B%23381%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fissues%2F381%29%29.+%28%5B9b366fd9%5D%28https%3A%2F%2Fgithub.com%2Finvertase%2Fmelos%2Fcommit%2F9b366fd917792dbdde1ed59a51beefd46bb88c57%29%29%0A%0A&prerelease=false

Unedited release created from generated URL

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Oct 13, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@blaugold blaugold left a comment

Choose a reason for hiding this comment

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

Basically LGTM, besides the one comment.

I would also put this behind a flag for melos version, e.g. --git-host-release-url and short -r. There are potentially multiple long URLs that get printed and might confuse/annoy users that don't use them.

packages/melos/lib/src/commands/version.dart Outdated Show resolved Hide resolved
@Almighty-Alpaca
Copy link
Contributor Author

I would also put this behind a flag for melos version, e.g. --git-host-release-url and short -r. There are potentially multiple long URLs that get printed and might confuse/annoy users that don't use them.

Should the flag be enabled or disabled by default?

@blaugold
Copy link
Collaborator

I meant disabled by default. My gut feeling is that this is more of a specialized feature, only some users take advantage of, but I might be wrong.

An alternative to the command line flag is an option under command/version in melos.yaml.

@Almighty-Alpaca
Copy link
Contributor Author

Small design note: I've for release.enabled: true instead of release: true to leave room for other release related configurations in the future, e.g. when implementing automatic release creation.

I've also gone ahead and added the new options to the documentation.

@blaugold blaugold force-pushed the feat/github-release-url branch from 6c38c54 to 6a8b82c Compare October 17, 2022 16:13
@blaugold blaugold changed the title feat: Implement creating URLs to prefilled GitHub release forms when executing melos version feat: output URLs to prefilled GitHub release forms when executing melos version Oct 17, 2022
@blaugold
Copy link
Collaborator

Thanks for also updating the docs!

I've clean up a few things, including renaming --git-release-url to --release-url and putting the option in melos.yaml under command/version/releaseUrl. We eventually would like to make all command options configurable in melos.yaml and maintaining the same structure and names will make that easier.

@blaugold blaugold merged commit 9c22cfb into invertase:main Oct 17, 2022
@blaugold blaugold linked an issue Oct 17, 2022 that may be closed by this pull request
1 task
@Almighty-Alpaca
Copy link
Contributor Author

Thanks 👍

@Almighty-Alpaca Almighty-Alpaca deleted the feat/github-release-url branch October 23, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request: Automatically create GitHub releases
3 participants