-
Notifications
You must be signed in to change notification settings - Fork 752
feat: debounce rfc index refresh #10708
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
Merged
jennifer-richards
merged 10 commits into
ietf-tools:main
from
jennifer-richards:dirtytracker
Apr 14, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
459969c
feat: DirtyBits model + admin
jennifer-richards c956a05
style: ruff + modernize utils/admin.py
jennifer-richards 931e9bc
chore: remove unused code
jennifer-richards ff92c1f
feat: rfcindex DirtyBits helpers
jennifer-richards 3b8c1c8
feat: refresh RFC index only when dirty
jennifer-richards d527713
test: update test
jennifer-richards 7bf37c7
fix: typo
jennifer-richards 4a26eaf
chore: add (empty) DirtyBits resource
jennifer-richards 1494b84
fix: actually call mark_rfcindex_as_processed
jennifer-richards b9ac30a
Merge branch 'main' into dirtytracker
jennifer-richards 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1,30 @@ | ||
| # Copyright The IETF Trust 2011-2020, All Rights Reserved | ||
| # -*- coding: utf-8 -*- | ||
| # Copyright The IETF Trust 2011-2026, All Rights Reserved | ||
|
|
||
|
|
||
| from django.contrib import admin | ||
| from django.utils.encoding import force_str | ||
|
|
||
| def name(obj): | ||
| if hasattr(obj, 'abbrev'): | ||
| return obj.abbrev() | ||
| elif hasattr(obj, 'name'): | ||
| if callable(obj.name): | ||
| name = obj.name() | ||
| else: | ||
| name = force_str(obj.name) | ||
| if name: | ||
| return name | ||
| return str(obj) | ||
|
|
||
| def admin_link(field, label=None, ordering="", display=name, suffix=""): | ||
| if not label: | ||
| label = field.capitalize().replace("_", " ").strip() | ||
| if ordering == "": | ||
| ordering = field | ||
| def _link(self): | ||
| obj = self | ||
| for attr in field.split("__"): | ||
| obj = getattr(obj, attr) | ||
| if callable(obj): | ||
| obj = obj() | ||
| if hasattr(obj, "all"): | ||
| objects = obj.all() | ||
| elif callable(obj): | ||
| objects = obj() | ||
| if not hasattr(objects, "__iter__"): | ||
| objects = [ objects ] | ||
| elif hasattr(obj, "__iter__"): | ||
| objects = obj | ||
| else: | ||
| objects = [ obj ] | ||
| chunks = [] | ||
| for obj in objects: | ||
| app = obj._meta.app_label | ||
| model = obj.__class__.__name__.lower() | ||
| id = obj.pk | ||
| chunks += [ '<a href="/admin/%(app)s/%(model)s/%(id)s/%(suffix)s">%(display)s</a>' % | ||
| {'app':app, "model": model, "id":id, "display": display(obj), "suffix":suffix, } ] | ||
| return ", ".join(chunks) | ||
| _link.allow_tags = True | ||
| _link.short_description = label | ||
| _link.admin_order_field = ordering | ||
| return _link | ||
| from .models import DumpInfo, DirtyBits | ||
|
|
||
|
|
||
| class SaferStackedInline(admin.StackedInline): | ||
| """StackedInline without delete by default""" | ||
|
|
||
| can_delete = False # no delete button | ||
| show_change_link = True # show a link to the resource (where it can be deleted) | ||
|
|
||
|
|
||
| class SaferTabularInline(admin.TabularInline): | ||
| """TabularInline without delete by default""" | ||
|
|
||
| can_delete = False # no delete button | ||
| show_change_link = True # show a link to the resource (where it can be deleted) | ||
|
|
||
|
|
||
| from .models import DumpInfo | ||
| @admin.register(DumpInfo) | ||
| class DumpInfoAdmin(admin.ModelAdmin): | ||
| list_display = ['date', 'host', 'tz'] | ||
| list_filter = ['date'] | ||
| admin.site.register(DumpInfo, DumpInfoAdmin) | ||
| list_display = ["date", "host", "tz"] | ||
| list_filter = ["date"] | ||
|
|
||
|
|
||
| @admin.register(DirtyBits) | ||
| class DirtyBitsAdmin(admin.ModelAdmin): | ||
| list_display = ["slug", "dirty_time", "processed_time"] |
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,37 @@ | ||
| # Copyright The IETF Trust 2026, All Rights Reserved | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("utils", "0002_delete_versioninfo"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="DirtyBits", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.AutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ( | ||
| "slug", | ||
| models.CharField( | ||
| choices=[("rfcindex", "RFC Index")], max_length=40, unique=True | ||
| ), | ||
| ), | ||
| ("dirty_time", models.DateTimeField(blank=True, null=True)), | ||
| ("processed_time", models.DateTimeField(blank=True, null=True)), | ||
| ], | ||
| options={ | ||
| "verbose_name_plural": "dirty bits", | ||
| }, | ||
| ), | ||
| ] |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.