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

Is there any way to get unreleased PR's? #725

Closed
lucasgismondi-bitbuy opened this issue Apr 5, 2022 · 24 comments
Closed

Is there any way to get unreleased PR's? #725

lucasgismondi-bitbuy opened this issue Apr 5, 2022 · 24 comments
Assignees

Comments

@lucasgismondi-bitbuy
Copy link

Is it possible to get all PR's from the latest release tag to now?

I tried to use the commit sha from the latest release to the current commit sha but with no luck. Is there any way this can be achieved?

Thank you!

@mikepenz
Copy link
Owner

mikepenz commented Apr 5, 2022

Hi @lucasgismondi-bitbuy

Thank you very much for the ticket.

Currently this action is focusing around merged PRs.

Could you may outline a bit on your usecase to understand better on this ask?

@mikepenz mikepenz self-assigned this Apr 5, 2022
@lucasgismondi-bitbuy
Copy link
Author

lucasgismondi-bitbuy commented Apr 5, 2022

Hey @mikepenz, thanks for the reply.

Within our changelog we are looking to include PR's that are "unreleased" so that our QA and other internal teams can know exactly what is coming up and what has already been released to production.

It would still be getting merged PR's but it would be PR's from the latest release to now. Essentially the toTag would have no bound

@mikepenz
Copy link
Owner

mikepenz commented Apr 5, 2022

That's an interesting usecase.

You outline the toTag to have no bound, but given the note you'd still like to have those in a unreleased section. would those be meant to follow a similar categorisation, or could it be a plain unreleased section with everything listed? Filtered by some label?

It's an interesting feature proposal, and I believe it could add further value to the action.

@lucasgismondi-bitbuy
Copy link
Author

Yes, I would expect it to follow a similar categorization. If it can get a list of PR's that are "unreleased" then it should be able to read the labels on those PR's and sort them accordingly. I'm not sure if that is actually possible though on the actions side but that is what I would expect. If it's just easier to have a plain unreleased section with everything listed, that is still a viable solution.

Yeah, I think it's super interesting as well. It can help make the changelog the single source of truth instead of relying on other ticket management tools that require more manual work to keep things organized.

@mikepenz
Copy link
Owner

mikepenz commented Apr 8, 2022

@lucasgismondi-bitbuy if you could please have a look at the following PR and maybe see if it matches your requirements: \

@lucasgismondi-bitbuy
Copy link
Author

Hey @mikepenz thank you very much for your quick work on this. I may be misunderstanding but does this PR make it possible to get PR's that have been merged that are not part of a release tag yet? I'm only seeing that you can get PR's in open state.

@mikepenz
Copy link
Owner

mikepenz commented Apr 11, 2022

@lucasgismondi-bitbuy as before those should be included if you use the latest commit hash (as toTag) on the branch those were merged into up until the tag which you want to use as fromTag.

@mikepenz
Copy link
Owner

Btw. if you want to quickly test and iterate on configurations. it is possible to run this action locally via npm on your computer towards any repo.

@lucasgismondi-bitbuy
Copy link
Author

Ah ok, thanks for the tip. I'm new to actions. I will try that again and report back!

@mikepenz
Copy link
Owner

mikepenz commented Apr 11, 2022

Screenshot 2022-04-11 at 18 23 24

In a strongly simplified fashion the following should outline your usecase.

Screenshot 2022-04-11 at 18 24 33

If you look at the config it refers the hash instead the tag.
and 1 open PR. (https://github.com/mikepenz/release-changelog-builder-action-playground/pulls)

using a special tag --rcba-open to add additional flexibility when configuring the sections you may want.

@lucasgismondi-bitbuy
Copy link
Author

So my workflow step looks like this at the moment:

- name: Build Changelog
        id: build_changelog
        uses: mikepenz/release-changelog-builder-action@v1
        with:
          fromTag: "3.77.0"
          toTag: "${{ github.sha }}"
          configuration: "changelog_config.json"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I also tried referencing an existing hash manually and I also tried using "v3.77.0" for the fromTag but I'm getting this:
image

Any ideas as to why this may be failing?

@mikepenz
Copy link
Owner

Could it be that the TOKEN is invalid?

Also it looks you are using v1 while we are already at v2.9.0 and the specific branch created for you with the new feature would have the SHA-1 (df9a355 - which you can use as version spec)

@lucasgismondi-bitbuy
Copy link
Author

The token is definitely valid since it works very well between two releases. I tried using 2.9.0 and the new branch sha but neither of those worked. But before this PR was created, was it expected that you can get merged PR's between a release tag and any commit sha that came after that? If so, I'm not sure if the PR you linked is needed since we don't need to reference open PR's

@mikepenz
Copy link
Owner

You can enable debug logging which should give you additional details on the reason for the failure:
https://docs.github.com/en/github-ae@latest/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
When you verify the sha used looks correct?
Other than that usual common causes for something like this may be wrong scope/permissions of the token.

Yes it is and was possible before this PR to retrieve merged PRs between 2 git hashes.
So that's great news of things already being available as needed prior to the PR.


I can assist to setup local debugging if you wish to iterate faster, or guide you in this direction.

@lucasgismondi-bitbuy
Copy link
Author

Yes, the sha used is correct in both scenarios (using "${{ github.sha }}" or inserting manually)

Thank you very much for all the support you've provided. As of right now this action works very well for automating our changelog on release. I'm going to have to come back to this and iterate on this in the future.

@mikepenz
Copy link
Owner

mikepenz commented Apr 12, 2022

@lucasgismondi-bitbuy thank you. So you found the cause for the HttpError: Not found issue? Maybe I missed you saying that this was resolved 🤔

@lucasgismondi-bitbuy
Copy link
Author

No this issue hasn't been resolved yet. I will come back to this probably within a few weeks

@mikepenz mikepenz removed the feature label May 13, 2022
@mikepenz
Copy link
Owner

mikepenz commented May 13, 2022

Closing this issue due to inactivity. Please re-open with additional information so we can investigate further and resolve it :)

Given the error it looks that it is most likely an access issue

@dtcMLOps
Copy link

dtcMLOps commented Jan 1, 2023

Hi @mikepenz @lucasgismondi-bitbuy, actually this is a great feature request. According to the best practices for changelogs having an Unreleased section would make sense.

Use "Unreleased" section to help users and project developers to stay informed on the upcoming changes. It also helps you at release time - just move changes from this section into the new version section.

I was trying to achieve this with the ${{OPEN_COUNT}}, but this retrieves the count of opened PRs, it would be nice to have the same structure as in the body categorize per features, bug fixes, etc in the unreleased section for opened PRs.

Screenshot from 2023-01-01 10-56-06

@mikepenz
Copy link
Owner

mikepenz commented Jan 2, 2023

@dtcMLOps You can enable to includeOpen PRs by doing:
Screenshot 2023-01-02 at 10 31 57

Which will result in open PRs being included for the changelog generation. (please note that they are included in the general set of PRs and are to be categorized with the category)

@dtcMLOps
Copy link

dtcMLOps commented Jan 2, 2023

Hi @mikepenz, yes indeed I have set the includeOpen parameter and as you mentioned this will add the open PRs in the same changelog body, but according to the best practices for changelogs these opened PRs should be in an Unreleased section since it not make sense to have both release and unreleased changes in the same body.

@mikepenz
Copy link
Owner

mikepenz commented Jan 3, 2023

@dtcMLOps I'll need to think of some additional APIs to make the category more flexible

@dtcMLOps
Copy link

dtcMLOps commented Jan 6, 2023

@lucasgismondi-bitbuy this feature has been released in the latest version v3.6.0. #997

Screenshot from 2023-01-06 06-22-36

@lucasgismondi-bitbuy
Copy link
Author

Awesome, thanks @dtcMLOps !

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

No branches or pull requests

3 participants