Skip to content

(maint) - Set max_issues for changelog generator to 500 #1285

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

Merged
merged 1 commit into from
Aug 3, 2021

Conversation

david22swan
Copy link
Member

@david22swan david22swan commented Aug 3, 2021

Tests failures are from a known issue and unrelated to changes.

@david22swan david22swan requested a review from a team as a code owner August 3, 2021 08:37
Rakefile Outdated
@@ -53,6 +53,7 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
config.add_pr_wo_labels = true
config.issues = false
config.max_issues = 500
Copy link
Collaborator

Choose a reason for hiding this comment

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

After 500 issues, what happens? Is it the oldest ones that get dropped?

Copy link
Collaborator

Choose a reason for hiding this comment

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

actually, how does this even apply for this project, where github issues are disabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, nothing get's dropped, it just ignores anything past that. If they are already in the changelog they will stay there, but if something where to happen, i.e. their label where to change, they wouldn't be updated like they would be now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure? I can't reproduce that. Testing this behaviour is a bit tricky though as even if you set max_issues to a very small number, a minimum of 100 are fetched. https://github.com/github-changelog-generator/github-changelog-generator/blob/d801469b07932c3647fafa7fed2796fa3b9ebff4/lib/github_changelog_generator/octo_fetcher.rb#L17

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeh, we previously used this fix for apache, though it was accidentally stripped by a pdk update, so I'm confident it will cause no problems

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok. I'm guessing that anything that wasn't fetched happens to be older than 5.3.0 and is covered by what's in HISTORY.md

Copy link
Member Author

@david22swan david22swan Aug 3, 2021

Choose a reason for hiding this comment

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

Ah, no.
This work's separately from the HISTORY.md.

With the HISTORY.md it set's a hard end point, cover everything up to this and if something doesn't match what it retrieves, it changes it. As in, if you reach this point, stop.
This change however rather than setting a goal, makes it so that once it reaches the set amount of issues, it it stops looking any further and simply accepts what comes after that point is correct and doesn't need to be looked at. As in, if you travel this distance, stop.

The two are separate, but complementary.

I'm sorry if I'm not explaining it that well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I always thought the CHANGELOG.md was regenerated completely when github-changelog-generator was run.
So... I tested by setting max_issues to 100 (the smallest number that makes a difference since the issues are fetched in batches of 100). Existing entries get removed (unless they're part of HISTORY.md that just gets appended verbatim). See alexjfisher@123ab70

But I guess if this ever does become a problem then there's the solution. Just prepend some of the existing CHANGELOG.md to HISTORY.md as a workaround.

@david22swan david22swan force-pushed the maint/main/max_issues branch from db5847f to 15a4318 Compare August 3, 2021 12:04
@sheenaajay
Copy link
Contributor

Thank you @david22swan @alexjfisher

@sheenaajay sheenaajay merged commit a9779c1 into puppetlabs:main Aug 3, 2021
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.

3 participants