-
Notifications
You must be signed in to change notification settings - Fork 874
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
Better validate changelog #1519
Conversation
As I suspected, the validation is not working correctly. See this output.
The actual changelog has entries for This explains why deploy fails. Each time we deploy, the deploy action retrieves the version of the release and then attempts to use the validation tool to extract the release notes for that version to post as release notes here on GitHub. This action is supposed to ensure the changelog is valid before doing the release so that the release succeeds. Looks like we may need to switch tools. |
Note, I have added a new label I have not done so yet, but we might want to also confirm that the actual version number of the release matches the version of the most recent entry in the changelog. In the deploy action we obtain the version number from the tag, but in a 'bump version' PR, the tag hasn't been set yet so we would need to retrieve the version from the code. |
So apparently the changelog was so bad that the validator was simply not recognizing it properly. First of all, Semantic Versioning requires all 3 of MAJOR, MINOR and PATCH to be set on every version. In other words, Another issue is that the Keep a Changelog format apparently does not allow any headers within an entry. However, for every one of our MAJOR releases (and some MINORs) we have used headers (h4+) to break up and categorize our notes. When those were previously not raising any validation errors, I assumed this was allowed. However, it seems that the validation tool was skipping those sections due to the missing PATCH on the version number. As I have since fixed the versions, we are now getting validation errors for these entries (see this example). That will need to be fixed which will require a major refactoring of the changelog. We could switch tools to avoid this issue from reappearing, but I don't think that is necessary. First of all, we have a section at the end of the changelog which links to the older (pre 3.0) changelong. We want that section to be ignored by the validator. A stricter validator would require us to change that in some way also. Also, if we add retrieval and comparison of the latest version (as I mentioned in a previous comment), that should avoid any issues with new entries not being properly recognized as an entry. However, we can revisit that after we get the changelog to validate properly. |
It appears that the validation tool is not reporting unleased status as I expect. We may need to use a different tool after all. |
After some experiments I have worked out that if the validator is run |
Ah, I need to normalize |
This seems to now be working as intended. The one thing I didn't expect is that adding or removing a label does not change things when a job is rerun. A new commit needs to be pushed. |
This is my attempt to ensure changelog validation catches issues so that deployment doesn't fail.