Repository navigation
Story 2673: Correct future bug of boost version ordering #2828
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
Changes from all commits
a5836de
164da4b
c79ccd5
337d20e
1c05380
b7144d7
1b1dbb3
f45f870
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,10 +47,12 @@ def command(release: str, new: bool, min_version: str): | |||||||||||||||||||||||||||||||||||||
| processed. | ||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||
| click.secho("Saving links to version-specific library docs...", fg="green") | ||||||||||||||||||||||||||||||||||||||
| min_version_parts = [int(part) for part in min_version.split(".")] | ||||||||||||||||||||||||||||||||||||||
| version_qs = ( | ||||||||||||||||||||||||||||||||||||||
| Version.objects.with_partials() | ||||||||||||||||||||||||||||||||||||||
| .active() | ||||||||||||||||||||||||||||||||||||||
| .filter(name__gte=f"boost-{min_version}") | ||||||||||||||||||||||||||||||||||||||
| .with_version_split() | ||||||||||||||||||||||||||||||||||||||
| .filter(version_array__gte=min_version_parts) | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+50
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Show the click option definitions (default for min_version)
sed -n '1,28p' "$(fd -p 'import_library_version_docs_urls.py$' | head -1)"
# Check whether beta versions are expected to be processed by this command/task
rg -n -C3 'import_library_version_docs_urls|beta' --type=py -g '!**/tests/**' | head -80Repository: boostorg/website-v2 Length of output: 4957 🏁 Script executed: #!/bin/bash
set -e
file="$(fd -p 'import_library_version_docs_urls.py$' | head -1)"
printf '%s\n' '--- command ---'
cat -n "$file"
printf '%s\n' '--- with_version_split definitions/usages ---'
rg -n -C8 'def with_version_split|with_version_split\\(' --glob '*.py'
printf '%s\n' '--- MINIMUM_BOOST_VERSION definitions ---'
rg -n -C5 'MINIMUM_BOOST_VERSION' --glob '*.py' --glob '*.env*' --glob '*.toml' --glob '*.yml' --glob '*.yaml'Repository: boostorg/website-v2 Length of output: 4367 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- MINIMUM_BOOST_VERSION ---'
rg -n -C5 --fixed-strings 'MINIMUM_BOOST_VERSION' .
printf '%s\n' '--- with_version_split references ---'
rg -n -C8 --fixed-strings 'with_version_split' .
printf '%s\n' '--- version model outline/files ---'
fd -i 'version' --type f | head -40Repository: boostorg/website-v2 Length of output: 13988 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- manager implementation ---'
cat -n versions/managers.py | sed -n '1,115p'
printf '%s\n' '--- docs-url command tests and beta references ---'
rg -n -C6 'import_library_version_docs_urls|documentation_urls|beta[[:alnum:]_.-]*' --glob '*.py' --glob '!versions/models.py' --glob '!versions/tasks.py' --glob '!reports/models.py'
printf '%s\n' '--- version creation beta names ---'
cat -n versions/tasks.py | sed -n '35,135p'Repository: boostorg/website-v2 Length of output: 41782 🏁 Script executed: #!/bin/bash
set -e
file='libraries/management/commands/import_library_version_docs_urls.py'
printf '%s\n' '--- merge-base command ---'
git show e287d0e92e376ec4a333b832b55497c66983657c:"$file" | cat -n | sed -n '1,90p'
printf '%s\n' '--- current command references ---'
rg -n -C8 --fixed-strings 'import_library_version_docs_urls' .
printf '%s\n' '--- beta import and docs-url workflow references ---'
rg -n -C8 'import_beta_release|update_library_version_documentation_urls_all_versions|get_and_store_library_version_documentation_urls_for_version' --glob '*.py'Repository: boostorg/website-v2 Length of output: 30352 Validate The default is valid (
Suggested validation fix- min_version_parts = [int(part) for part in min_version.split(".")]
+ try:
+ min_version_parts = [int(part) for part in min_version.split(".")]
+ except (AttributeError, TypeError, ValueError) as exc:
+ raise click.BadParameter(
+ f"Invalid --min-version {min_version!r}"
+ ) from exc📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
| if release: | ||||||||||||||||||||||||||||||||||||||
| versions = version_qs.filter(name__icontains=release).order_by("-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.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
The minimum version now gets its diff and commits from the wrong base.
The old loop kept the pair (last version below
min_version, first version at or abovemin_version). The new queryset filter removes every version below the floor. The list becomes["", <first version >= min>, ...]. The first pair is therefore("", "boost-1.92.0").With that pair, git runs
diff ..boost-1.92.0andlog ..boost-1.92.0. Git reads these asHEAD..boost-1.92.0, and in the bare cloneHEADis the default branch. The code then yields aVersionDiffStatandParsedCommitrecords for the minimum version that do not describe its release. Only the full import (nomin_version) keeps the correct base.Keep the full ordered list and skip pairs by the numeric value of
b:Proposed fix
min_versionhas one more problem. If it does not matchboost-X.Y.Z(for example1.92.0),parsed_mvbecomes[], and no floor is applied. The function then reprocesses every version and gives no warning. Raise an error or log a warning when a non-emptymin_versiondoes not parse.🤖 Prompt for AI Agents