Repository navigation
Story 2824: Update functionality of C++ filtering on Library Page #2848
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
Open
jlchilders11
wants to merge
4
commits into
develop
Choose a base branch
from
jc/2824-min-version-library-filtering
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
39 changes: 39 additions & 0 deletions
39
libraries/management/commands/import_library_maximum_cxx_version.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import djclick as click | ||
| import openpyxl | ||
|
|
||
| from libraries.models import Library | ||
|
|
||
|
|
||
| @click.command() | ||
| @click.option( | ||
| "--filename", | ||
| help="Optional filename to import values from. Defaults to 'boost_cxx_ceilings.xlsx", | ||
| default="boost_cxx_ceilings.xlsx", | ||
| ) | ||
| def command(filename): | ||
| click.echo(f"Opening workbook: {filename}") | ||
| wb = openpyxl.load_workbook(filename) | ||
| ws = wb.active | ||
| rows = ws.iter_rows(values_only=True) | ||
| header = next(rows) # get the header row | ||
| data = [] | ||
| for row in rows: | ||
| data.append(dict(zip(header, row))) | ||
| click.echo(f"Found {len(data)} rows to update.") | ||
| libs_to_update = [] | ||
| libs_not_updated = [] | ||
| libs = Library.objects.all() | ||
| for obj in data: | ||
| try: | ||
| lib = libs.get(key=obj.get("Library")) | ||
| except Library.DoesNotExist: | ||
| libs_not_updated.append(obj.get("Library")) | ||
| continue | ||
| if lib_max := obj.get("CI max tested"): | ||
| lib.cpp_standard_maximum = lib_max | ||
| libs_to_update.append(lib) | ||
| click.echo(f"Was able to match {len(libs_to_update)} libraries.") | ||
| if len(libs_not_updated) > 0: | ||
| click.echo(f"Was unable to match libraries: {(', ').join(libs_not_updated)}.") | ||
| Library.objects.bulk_update(libs_to_update, fields=["cpp_standard_maximum"]) | ||
| click.echo("Finished.") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Generated by Django 6.0.2 on 2026-10-01 19:41 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("libraries", "0047_merge_20260828_1858"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="library", | ||
| name="cpp_standard_maximum", | ||
| field=models.CharField(blank=True, max_length=50, null=True), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: boostorg/website-v2
Length of output: 41078
🤖 get_repo_knowledge executed:
get_repo_knowledge boostorg/website-v2 /tmp/coderabbit-repo-knowledge/boostorg-website-v2-fdf2976b/architecture /tmp/coderabbit-repo-knowledge/boostorg-website-v2-fdf2976b/learningsLength of output: 45142
🏁 Script executed:
Repository: boostorg/website-v2
Length of output: 19338
Handle duplicate
Library.keyvalues before the lookup.Library.keyhas no uniqueness constraint. If a workbook key matches multipleLibraryrows,libs.get(...)raisesLibrary.MultipleObjectsReturned. The handler catches onlyLibrary.DoesNotExist, so the command exits beforebulk_update. Define the duplicate-key policy, such as rejecting and reporting duplicates or updating all intended matches.🤖 Prompt for AI Agents