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

Add more logging to the copr-builder-ready script #3484

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/copr_backend/background_worker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def _check_vm(self):
# generalize it into a separate package that we could eventually use
# here.
cmd = "copr-builder-ready " + self.job.chroot
self.log.info("Running remote command: %s", cmd)
Copy link
Member

Choose a reason for hiding this comment

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

nit: ton't you want to show stderr, if provided? might give us some warnings in advance

Copy link
Member Author

Choose a reason for hiding this comment

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

We do

if rc:
    self.log.info(stderr)

which should IMHO work fine.

Copy link
Member

Choose a reason for hiding this comment

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

but if rc == 0 and there's some output, we just swallow it

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it this way because for some reason my stderr is polluted by this line when testing this locally

Shared connection to builder closed.

So I intentionally wanted to swallow it. But we haven't seen that message in STG so I am confused.

Copy link
Member

Choose a reason for hiding this comment

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

🤷 if you want to hear my opinion, I don't think the logs need to be pretty - but must be complete (minus credentials, haha). But it is up to you, I already approved this PR.

rc, stdout, stderr = self.ssh.run_expensive(
cmd, subprocess_timeout=660)
self.log.info(stdout)
Expand Down
3 changes: 3 additions & 0 deletions rpmbuild/bin/copr-builder-ready
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def main():
check_mock_config(chroot)
if subscription_required(chroot):
wait_for_subscription()
else:
print("Red Hat subscription not needed for {0}".format(chroot))
print("Builder is ready to be used")


if __name__ == "__main__":
Expand Down