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 debug message for expected build tag #543

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

rd4398
Copy link
Contributor

@rd4398 rd4398 commented Feb 5, 2025

This commit adds a debug message for expected_build_tag and logs the change log entries for debug

Further, new version of pbr released few days ago which breaks our e2e test for test_bootstrap_constraints.sh. The pbr version is now updated to 6.1.1 for the test

Signed-off by: Rohan Devasthale

@rd4398 rd4398 requested a review from dhellmann February 5, 2025 20:35
@rd4398 rd4398 force-pushed the expected-tag-message branch from 39375f3 to 57402b1 Compare February 5, 2025 20:39
@@ -323,6 +323,10 @@ def _download_wheel_from_cache(
wheelfile_name = pathlib.Path(urlparse(wheel_url).path)
pbi = self.ctx.package_build_info(req)
expected_build_tag = pbi.build_tag(resolved_version)
# Log the expected build tag for debugging
if expected_build_tag:
Copy link
Member

Choose a reason for hiding this comment

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

The goal is to log more complete debug information about the build tag, so that someone looking at the log can understand why fromager took whatever steps it did. So we want a message even if there is no build tag.

@rd4398
Copy link
Contributor Author

rd4398 commented Feb 5, 2025

test_bootstrap_constraints.sh e2e is failing in CI

I tried to reproduce it locally but I get the message

++ source .tox/e2e/bin/activate
/home/rdevasth/fromager/e2e/common.sh: line 27: .tox/e2e/bin/activate: No such file or directory

I checked and .tox/e2e/bin/activate exists locally. Any idea how I can debug / fix this?

@dhellmann
Copy link
Member

test_bootstrap_constraints.sh e2e is failing in CI

I tried to reproduce it locally but I get the message

++ source .tox/e2e/bin/activate
/home/rdevasth/fromager/e2e/common.sh: line 27: .tox/e2e/bin/activate: No such file or directory

I checked and .tox/e2e/bin/activate exists locally. Any idea how I can debug / fix this?

To run the tests, start in the root of the git repository and run the script by it's path like this:

./e2e/test_bootstrap_constraints.sh

When I do that I see the same failure.

@mergify mergify bot added the ci label Feb 6, 2025
@rd4398 rd4398 force-pushed the expected-tag-message branch from 86c24ea to 217a90d Compare February 6, 2025 18:57
logger.info(f"{req.name}: has expected build tag {expected_build_tag}")
# Get changelogs for debug info
changelogs = pbi.get_changelog(resolved_version)
logger.info(f"{req.name} has change logs {changelogs}")
Copy link
Member

Choose a reason for hiding this comment

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

Logging at info level here is going to be pretty noisy. The thing we really care about at info level is the number (the expected build tag), which you're logging on 327. So maybe change this to a debug message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, makes sense

@rd4398 rd4398 force-pushed the expected-tag-message branch from ec0593e to 3042e90 Compare February 6, 2025 20:54
@@ -638,6 +638,10 @@ def build_tag(self, version: Version) -> BuildTag:
suffix = ""
return release, suffix

def get_changelog(self, version: Version) -> list[str]:
pv = typing.cast(PackageVersion, version)
return self._ps.changelog.get(pv, [])
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I just noticed this. If you look at lines 633 and 634, you'll see that the build_tag is computed by combining the variant changelog and the package changelog. If we're returning a list here so we can log it, we should combine the same values.

Then in build_tag, we could use this method to get the changelog and just take the length of that result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I see okay! I will push the updated code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have pushed latest code

@rd4398 rd4398 force-pushed the expected-tag-message branch from eb39778 to 338d0ac Compare February 6, 2025 21:13
@rd4398 rd4398 requested a review from paradigm February 6, 2025 21:14
@mergify mergify bot merged commit fac7ee6 into python-wheel-build:main Feb 6, 2025
77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants