-
Is your feature request related to a problem? Please describe. We've been using an internally developed tool at Pulumi for some of our changelog management. We're looking at switching over to I'd like to add this feature to changie as well. Describe the solution you'd like I've been playing around in the changie codebase and my current thinking for this feature is the following: Add a new config section to ".changie.yaml" called "GitHub" with two nested fields "Organization" and "Repository". If both of these are set then when loading changes from fragment files try to lookup what commit sha added that file via the local .git information (can use go-git for this), then query GitHub for what pull requests are associated with that commit and take the one that is merged. There are some questions around what to do if a commit is referenced by multiple merged PRs? Should we return the earliest PR number or all? Once the PR information is fetched add some extra template data when rendering the changelog. ".GitHub.PullRequest" which is the pull request number (or zero if one wasn't found) and ".GitHub.User" which is the user name associated with the pull request (or empty if no pull request was found). Describe alternatives you've considered My workaround to move to changie until this feature is in is I'm asking for pull request numbers as a a custom fragment entry. This is simple, and works but it means users have to push the change to make a pull request, see what pull request number they got, then create the changelog entry and re-push the change. Additional context You can see the code for our internal tool at https://github.com/pulumi/go-change/blob/main/internal/changelog/entry.go#L39. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Heyo Pulumi team, I would love to help but I do want to mention a few design rules of changie. First, changie only reads, writes and deletes files. It does not know about git, hosting or even the output format of the files. With the exception of the yaml fragments. So, with that said, adding go-git or any knowledge related to GitHub or any other host would go against the first point. However, I know this has come up before, I believe dagger.io was looking for this as well. My usual suggestion is to just use an issue number instead but changing to issues may not be an option. Brainstorming a little the option I would try out is to use an action to automatically add pr numbers to change fragments using a tool like yq for yaml parsing and updating. I would be willing to build an example and add that as a guide. Not sure what other option exists without breaking rule one. And without any sort of plugin support adding that is also not possible. |
Beta Was this translation helpful? Give feedback.
-
I can respect that. Strong design guidelines generally lead to better tools so I do not want to be pushy about this.
Interesting, I'll give this issue link a post on their discord see if they have anything to chime in here.
Yes I saw that was what changie was doing, and it seems fairly reasonable. I'll definitely talk to the team about if we want to just do that instead as an option.
I don't think I know GitHub actions well enough to see what you mean here? Are you suggesting having an action run on the PR merge to edit the yaml file with the PR number just before it commits to master? It's an interesting idea, I wouldn't worry about taking the time to build a concrete example for it just yet though.
I was musing about plugin systems and thought this might be doable with just a very simple system. List a keyed executable in the .changie.yml config, for each change call that executable with the JSON marshaled
On loading the Change call An idea, but I'll talk to our team some more about this and see if dagger have any input before saying its wise to action anything here. |
Beta Was this translation helpful? Give feedback.
-
Linking a dagger issue about their use of PR numbers to this: dagger/dagger#5475 |
Beta Was this translation helpful? Give feedback.
-
The action would do: That's all. |
Beta Was this translation helpful? Give feedback.
-
Ah yeh that doesn't seem too complex. I'll be sure to add that to list of possibilities to discuss internally. Thank you. |
Beta Was this translation helpful? Give feedback.
We're trying it out in https://github.com/pulumi/pulumi-dotnet, with just the manual "push once get a PR number, create changelog, push again" workflow for now.
The autofix changelogs in PR workflow is interesting, but not so needed that we felt we needed to spend the time writing it right now.
It does feel like it would make a good reusable action though, if we get around to writing it first we'll probably go in that direction.