Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Sync to dist-git MR when source-git MR has been closed or reopened #62

Merged
merged 8 commits into from
May 10, 2022

Conversation

jpopelka
Copy link
Member

@jpopelka jpopelka commented May 3, 2022

@softwarefactory-project-zuul

This comment was marked as outdated.

jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 6, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
@jpopelka jpopelka changed the title WIP: Sync to dist-git MR when source-git MR has been closed or reopened Sync to dist-git MR when source-git MR has been closed or reopened May 6, 2022
@jpopelka jpopelka marked this pull request as ready for review May 6, 2022 17:11
@softwarefactory-project-zuul

This comment was marked as outdated.

jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 9, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 9, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 9, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
@softwarefactory-project-zuul

This comment was marked as outdated.

jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 9, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
Comment on lines 127 to 138
if (
self.target_repo_branch
not in self.packit.dg.local_project.git_project.get_branches()
):
msg = f"Downstream {self.target_repo}:{self.target_repo_branch} branch does not exist."
self.project.get_pr(int(self.mr_identifier)).comment(msg)
logger.info(msg)
return TaskResults(success=True)
Copy link
Member

Choose a reason for hiding this comment

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

We should probably put more text in the comment to guide contributors/maintainers.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was added in #56 and I don't think it'll happen too often because the source-git branches should in general match dist-git branches. But I tried to add more context to the message. Check the latest commit.

logger.error(f"Unknown action {self.action}")
return TaskResults(success=False)
logger.info(msg)
self.dist_git_pr.comment(msg)
Copy link
Member

Choose a reason for hiding this comment

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

I hope folks won't find this as spamming but it's totally significant to inform about such an action in the downstream PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, and in most cases, you close the source-git MR only once, so it's just one comment.

jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 9, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ pre-commit SUCCESS in 1m 40s
✔️ hardly-tests SUCCESS in 3m 18s

Comment on lines +132 to +134
"Can't create a dist-git pull/merge request out of this contribution "
f"because matching {self.target_repo_branch} branch does not exist "
f"in dist-git {self.target_repo} repo."
Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

jpopelka added a commit to jpopelka/packit-service that referenced this pull request May 10, 2022
I need this for hardly, where we want to react when a source-git MR gets closed.
packit/hardly#62
@jpopelka jpopelka added the mergeit When set, zuul wil gate and merge the PR. label May 10, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ pre-commit SUCCESS in 1m 39s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit d4e7601 into packit:main May 10, 2022
@jpopelka jpopelka deleted the close-mr branch May 10, 2022 10:29
softwarefactory-project-zuul bot added a commit that referenced this pull request May 18, 2022
Improve code added in #62

I initially wanted to attach these refactoring commits to some other PR, but I think they'll be better on their own.

Reviewed-by: None <None>
Reviewed-by: Jiri Popelka <None>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants