-
Notifications
You must be signed in to change notification settings - Fork 7
Dist-git MR's target branch to match source-git MR's target branch #56
Conversation
Build failed.
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
bf7bba0
to
83ad43c
Compare
Build failed.
|
Build failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should document the downstream_branch_name
somewhere. Given that it's hardly specific thing so far, probably in the hardly/README and we can move it somewhere else (packit.dev) later.
EDIT: Actually, we have source-git specific upstream_ref in the docs as well, so can put downstream_branch_name
there as well - mentioning that it's for source-git repos.
hardly/handlers/distgit.py
Outdated
@@ -89,6 +89,7 @@ def run(self) -> TaskResults: | |||
Please review the contribution and once you are comfortable with the content, | |||
you should trigger a CI pipeline run via `Pipelines → Run pipeline`.""" | |||
dg_mr = self.api.sync_release( | |||
dist_git_branch=self.package_config.downstream_branch_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure: so if downstream_branch_name
is not specified in the config, nothing changes, i.e. it'll still default to the default branch of the dist-git repository, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because sync_release
is called with dist_git_branch=None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed, so that when donstream_branch_name
is not specified use the current source-git branch name as the name of the target branch in dist-git.
Build failed.
|
hardly/handlers/distgit.py
Outdated
@@ -89,6 +89,7 @@ def run(self) -> TaskResults: | |||
Please review the contribution and once you are comfortable with the content, | |||
you should trigger a CI pipeline run via `Pipelines → Run pipeline`.""" | |||
dg_mr = self.api.sync_release( | |||
dist_git_branch=self.package_config.downstream_branch_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed, so that when donstream_branch_name
is not specified use the current source-git branch name as the name of the target branch in dist-git.
Makefile
Outdated
@@ -23,7 +23,7 @@ check: | |||
PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --color=$(COLOR) --verbose --showlocals --cov=hardly --cov-report=$(COV_REPORT) $(TEST_TARGET) | |||
|
|||
test-image: files/recipe-tests.yaml | |||
$(CONTAINER_ENGINE) build --rm -t $(TEST_IMAGE) -f files/Containerfile.tests --build-arg SOURCE_BRANCH=$(SOURCE_BRANCH) . | |||
$(CONTAINER_ENGINE) build --no-cache --rm -t $(TEST_IMAGE) -f files/Containerfile.tests --build-arg SOURCE_BRANCH=$(SOURCE_BRANCH) . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be something that is desired in every situation. If you think customization of these options is needed on a regular basis, then we should and a BUILD_OPTIONS
variable, or something similar, which could be used in such cases.
Fix/hardly/36 Fixes packit/hardly#36 Merge before packit/hardly#56 RELEASE NOTES BEGIN A new configuration option downstream_branch_name has been added, which is meant to be used in source-git projects and allow users to customize the name of the branch in dist-git which corresponds to the current source-git branch. RELEASE NOTES END Reviewed-by: Jiri Popelka <None> Reviewed-by: Hunor Csomortáni <[email protected]>
2e7a206
to
754eed6
Compare
Build failed.
|
In packit-service, we don't build the test image every time we run the tests, but we pull it from Quay. Shouldn't this be consistent, and done the same way here, too? @jpopelka what do you think? |
In packit-service we use the pre-built image because building the image takes a long time (it installs all the deps for worker and service and tests). In hardly we build the test image on top of worker (until #48) and install only a few libs for tests, which is much faster so it IMHO doesn't make sense to use a pre-built image in this case. But if the build problems don't "go away automagically", then we might, indeed, need to build it in Quay as we do with p-s, because I don't know how to fix them. |
Thank you for the explanation @jpopelka. I'll reach out to the softwarefactory folks and ask about this issue. |
754eed6
to
679af04
Compare
Build failed.
|
hardly/handlers/distgit.py
Outdated
if dist_git_branch not in self.api.dg.local_project.git_project.get_branches(): | ||
msg = f""" | ||
{self.target_repo}:{dist_git_branch} does not exist. | ||
A new branch with this name will be created into the downstream repo. | ||
""" | ||
self.project.get_pr(int(self.mr_identifier)).comment(msg) | ||
|
||
return dist_git_branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh, I wouldn't do this check here. If the branch doesn't exist in dist-git, there is nothing meaningful the bot could do: creating it is a release engineering task, it shouldn't be created on the fly. Another solution could be to set downstream_branch_name
, but that's also up to the maintainer to decide.
So if the branch doesn't exist in dist-git, opening the PR should simply fail.
Build failed.
|
68377f7
to
95e6a81
Compare
Build failed.
|
95e6a81
to
2ce1252
Compare
Build failed.
|
When creating a downstream MR use as target branch name or the same upstream target branch name or a custom one. Co-authored-by: Hunor Csomortáni <[email protected]>
2ce1252
to
bbeec3a
Compare
Build failed.
|
NOTE: tests are failing for the same reason already appeared in #55
Fixes #36
Merge after packit/packit#1555
Related with packit/packit.dev#430
RELEASE NOTES BEGIN
The user can now customize the name of the downstream branch using the
downstream_branch_name
configuration option.RELEASE NOTES END