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

Fix fedora-review error handling #2835

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Aug 6, 2023

Fix FrostyX/fedora-review-service#28
Fix https://pagure.io/FedoraReview/issue/486

The fedora-review commands fails with the following error:

ERROR: 'No disttag in package and no DISTTAG flag.
Use --define DISTTAG to set proper dist e. g., --define DISTTAG=fc21.'

It is strange to me why it cannot find any disttag in the package but
it is easy for us to specify it, so why not.

@FrostyX FrostyX force-pushed the fix-fedora-review branch 4 times, most recently from 3547398 to eaa27f8 Compare August 6, 2023 21:45
@@ -10,6 +10,7 @@

import os
import shutil
from copr_common.helpers import chroot_to_branch
Copy link
Member

Choose a reason for hiding this comment

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

+1 for moving the method

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 change is no longer needed because we won't use chroot_to_branch in copr-rpmbuild after all. But since you +1'd it, I left the commit there.

cmd = [
"fedora-review", "--no-colors", "--prebuilt", "--rpm-spec",
"--name", self.package_name,
"--mock-config", self.mock_config_file,
"--define", "DISTTAG={0}".format(branch),
Copy link
Member

Choose a reason for hiding this comment

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

This must be some bug in fedora-review, what am I missing? Is the package actually having the dist tag or not? (this must be bothering normal fedora-review users, not just Copr)

@FrostyX
Copy link
Member Author

FrostyX commented Aug 7, 2023

I made this way harder than it needed to be.

  • The ERROR: 'No disttag in package and no DISTTAG flag. was not the real issue. It only happened to me locally because of a mess in my /var/lib/copr-rpmbuild/results/. This is not why it fails in produciton.
  • However, the error handling is incorrect and the self._filter_results_directory() with some modification needs to be called even if the fedora-review command fails
  • The real issue from production is Cache-only enabled but no cache for repository "copr_base" which is related to DNF5. Therefore it should get fixed by using the up-to-date fedora-review package.

Copy link
Member

@praiskup praiskup left a comment

Choose a reason for hiding this comment

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

Thank you!

praiskup pushed a commit to praiskup/copr that referenced this pull request Aug 8, 2023
Fix FrostyX/fedora-review-service#28
Fix https://pagure.io/FedoraReview/issue/486

There is no fedora-review parameter for specifying the output
directory. As a work-around we are renaming its results directory to
"fedora-review" after the command finishes. However, our error
handling is wrong and if the `fedora-review` command fails, the rename
doesn't happend. Therefore, broken links. This commit fixes it.

Relates: fedora-copr#2835
@nikromen
Copy link
Member

nikromen commented Aug 8, 2023

/packit build

@FrostyX FrostyX changed the title Specify disttag when running fedora-review Fix fedora-review error handling Aug 8, 2023
Fix FrostyX/fedora-review-service#28
Fix https://pagure.io/FedoraReview/issue/486

There is no fedora-review parameter for specifying the output
directory. As a work-around we are renaming its results directory to
"fedora-review" after the command finishes. However, our error
handling is wrong and if the `fedora-review` command fails, the rename
doesn't happend. Therefore, broken links. This commit fixes it.
Copy link
Member

@praiskup praiskup left a comment

Choose a reason for hiding this comment

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

LGTM

@praiskup praiskup merged commit f006471 into fedora-copr:main Aug 9, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

review.txt link points to wrong location and the file is empty
3 participants