Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: providecontext.history global in release notes templates#1005

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@codejedi365
Copy link
Contributor

@codejedi365codejedi365 commentedAug 18, 2024
edited
Loading

Purpose

Rationale

Temporarily return thecontext.history variable to release notes generation as many users are using it in their release documentation. It was never intended to be provided and will be removed in the future.

Context was removed inv9.8.3 during a refactor and condensing of changelog and release notes functionality. Ends up the context was provided accidentally because of variable re-use rather than explicit definition which is why it broke upon refactor.

How did you test?

Performed some manual testing with a custom template upon the PSR repository. See the commands below for replication. The importance is that the release notes was printed to the console using--noop mode so we are sure that the formatting and use was working.

How to Verify

  1. Add the following file to PSR repository:

    {# file: templates/.release_notes.md.j2 #}{%setreleases =context.history.released.items() |list%}{%setprev_version_tag =releases[1][0].as_tag()%}{%setnew_version_tag =version.as_tag()%}{%setversion_compare_url =prev_version_tag |compare_url(new_version_tag)%}{%setdetailed_changes_link ='[{}...{}]({})'.format(prev_version_tag,new_version_tag,version_compare_url)%}---**Detailed Changes**: {{ detailed_changes_link }}
  2. Executesemantic-release --noop changelog --post-to-release-tag v9.8.6

…templatesTemporarily return the `context.history` variable to release notes generationas many users are using it in their release documentation. It was never intendedto be provided and will be removed in the future.context was removed in `v9.8.3` during a refactor and condensing of changelogand release notes functionality.Resolves:python-semantic-release#984
Some markdown sequences can be interpreted as ansi escape sequences which dilutedebugging of release note templates by the user. This change ensures the rawcontent is displayed to the console as expected.
@codejedi365codejedi365 self-assigned thisAug 20, 2024
@codejedi365codejedi365 merged commit5bd91b4 intopython-semantic-release:masterAug 20, 2024
@codejedi365codejedi365 deleted the fix/missing-context-in-release-notes branchAugust 20, 2024 04:30
maxrake added a commit to phylum-dev/phylum-ci that referenced this pull requestAug 21, 2024
This change is an update to the one made in#454. Since then, the`python-semantic-release` (PSR) dependency has responded to theirbreaking change by re-defining the `context` variable for release notestemplates. However, they also say that the variable was not meant tobe exposed in the first place and that it will be removed again in thenext major version release. Therefore, the pin has been changed to acaret-style one to allow for getting future releases that are at leastv9.8.7 but less than v10.Discussions with the maintainer are ongoing, to request the featuresrelied upon with the current implementation are accounted for in thenext major version release.References:*python-semantic-release/python-semantic-release#1005*python-semantic-release/python-semantic-release#984Additionally, the release notes template was refactored a tiny bit toaccount for new methods of doing the same thing, but with less code. Thechanges were tested locally and found to produce the same output as theprevious template.
maxrake added a commit to phylum-dev/phylum-ci that referenced this pull requestAug 21, 2024
This change is an update to the one made in#454. Since then, the`python-semantic-release` (PSR) dependency has responded to theirbreaking change by re-defining the `context` variable for release notestemplates. However, they also say that the variable was not meant to beexposed in the first place and that it will be removed again in the nextmajor version release. Therefore, the pin has been changed to acaret-style one to allow for getting future releases that are at leastv9.8.7 but less than v10.Discussions with the maintainer are ongoing, to request the featuresrelied upon with the current implementation are accounted for in thenext major version release.References:*python-semantic-release/python-semantic-release#1005*python-semantic-release/python-semantic-release#984Additionally, the release notes template was refactored a tiny bit toaccount for new methods of doing the same thing, but with less code. Thechanges were tested locally and found to produce the same output as theprevious template.
This was referencedFeb 5, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@codejedi365codejedi365

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

jinja2.exceptions.UndefinedError: 'context' is undefined

1 participant

@codejedi365

[8]ページ先頭

©2009-2025 Movatter.jp