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

Changelog refactor #1367

Merged

Conversation

mfocko
Copy link
Member

@mfocko mfocko commented Sep 20, 2021

TODO:

  • include warnings from related issue
    • add tests
  • test the action (I just realized, I tested it locally)

Fixes #1299

Related to

Merge before/after


Packit supports changelog-entry action that is used when creating SRPM, the action is supposed to generate whole changelog entry (including - at the start of the lines) and has a priority over any other way we modify the changelog with.

@mfocko mfocko changed the title Propose downstream changelog Changelog refactor Sep 20, 2021
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

Copy link
Member

@TomasTomecek TomasTomecek left a comment

Choose a reason for hiding this comment

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

nicely factored out! would be great to have more sensible method names with proper docstrings

release=release_to_update, changelog_entry=msg
)

def prepare_upstream_locally(self, version: str, commit: str) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rename this method to something which would resemble what it actually does; update_spec?

Copy link
Member Author

Choose a reason for hiding this comment

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

current name is the caller…

self.dg.get_absolute_specfile_path(),
)

def prepare_upstream_using_source_git(self) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

dtto

@TomasTomecek
Copy link
Member

@mfocko a friendly reminder you have this one still opened :)

Copy link
Member

@lachmanfrantisek lachmanfrantisek left a comment

Choose a reason for hiding this comment

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

Very nice clean up! I agree with Tomáš about the names and docstrings. Otherwise LGTM and ready to go!

(Can you please document the new action in packit.dev?)

Thanks!

@mfocko mfocko added high-prio has-release-notes PR includes release notes for changelog or weekly blog post. labels Oct 18, 2021
@mfocko mfocko force-pushed the propose-downstream-changelog branch from dda6bd0 to 1c1302d Compare November 1, 2021 10:44
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

if not messages:
return None

return "\n".join(map(lambda line: line.rstrip(), messages))
Copy link
Member

Choose a reason for hiding this comment

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

nicely done wrt .rstrip(), since the entries may contain important leading whitespace

Returns:
Changelog entry or `None` if action is not present.
"""
messages = self.up.get_output_from_action(ActionName.changelog_entry)
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if it makes sense to provide some env vars here to assist with the generation:

  • spec file? (well, they know where it is and it's constant)
  • project name, package name? dtto
  • version name of the release in-progress - this one would make sense even though HEAD should be git-tagged, so also easy to find out
  • git-log data - easy to find out
  • previous release - we don't know that
  • what else?

@mfocko mfocko force-pushed the propose-downstream-changelog branch from 1c1302d to c8a4504 Compare November 4, 2021 14:58
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

Signed-off-by: Matej Focko <mfocko@redhat.com>
Signed-off-by: Matej Focko <mfocko@redhat.com>
Signed-off-by: Matej Focko <mfocko@redhat.com>
Signed-off-by: Matej Focko <mfocko@redhat.com>
Signed-off-by: Matej Focko <mfocko@redhat.com>
Signed-off-by: Matej Focko <mfocko@redhat.com>
@mfocko mfocko force-pushed the propose-downstream-changelog branch from c8a4504 to 159c4c7 Compare November 10, 2021 10:57
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@mfocko mfocko added the mergeit When set, zuul wil gate and merge the PR. label Nov 10, 2021
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit f4c80da into packit:main Nov 10, 2021
@mfocko mfocko deleted the propose-downstream-changelog branch March 6, 2022 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-release-notes PR includes release notes for changelog or weekly blog post. mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downstream changelog wrongly created
3 participants