-
Notifications
You must be signed in to change notification settings - Fork 27
Task 2583: GitHub activity pipeline #2616
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
base: develop
Are you sure you want to change the base?
Changes from all commits
8dbf361
0b05a53
6503f93
b10e98e
4b028fe
7e25114
790a77c
f5332bb
3429085
394eae2
ede6d1e
58099e1
588e58b
3d6de5a
7bd59b2
47de0af
09f9206
a6c6059
9392720
222d8c6
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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {% extends "admin/change_form.html" %} | ||
| {% load i18n admin_urls %} | ||
|
|
||
| {% block submit_buttons_bottom %} | ||
| {{ block.super }} | ||
| {% if original and original.github_username %} | ||
| <div class="submit-row"> | ||
| {# POST, not a link: this queues work, so it must not be reachable by GET. #} | ||
| <form method="post" | ||
| action="{% url 'admin:user_refresh_github_activity' original.pk %}" | ||
| style="display: inline-block;"> | ||
| {% csrf_token %} | ||
| <button type="submit" | ||
| class="button" | ||
| style="background: #417690; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer;"> | ||
| {% trans "Refresh GitHub Activity" %} | ||
| </button> | ||
| </form> | ||
|
Comment on lines
+9
to
+18
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Verify the declared Django version and locate any overridden admin change form.
rg -n -C 2 'Django|django' pyproject.toml requirements*.txt setup.cfg tox.ini Pipfile* 2>/dev/null || true
fd -a 'change_form\.html$' . | while IFS= read -r file; do
echo "== $file =="
rg -n -C 3 'submit_buttons_bottom|<form' "$file"
doneRepository: boostorg/website-v2 Length of output: 10656 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== candidate templates =='
git ls-files | rg '(^|/)(templates/admin/.*change_form\.html|user_change_form\.html)$' || true
fd -a -i 'user_change_form\.html|change_form\.html' . | while IFS= read -r file; do
printf '\n== %s ==\n' "$file"
cat -n "$file"
done
printf '%s\n' '== related admin identifiers =='
rg -n -C 4 'user_refresh_github_activity|submit_buttons_bottom|user_change_form' . --glob '!*.lock' --glob '!requirements*.txt' || trueRepository: boostorg/website-v2 Length of output: 9591 🌐 Web query:
💡 Result: In Django 6.0, the Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== admin view and tests =='
cat -n users/admin.py | sed -n '1,125p'
printf '\n== admin tests ==\n'
cat -n users/tests/test_admin.py | sed -n '1,220p'
printf '%s\n' '== Django 6.0 template form boundaries =='
curl -fsSL https://raw.githubusercontent.com/django/django/stable/6.0.x/django/contrib/admin/templates/admin/change_form.html \
| nl -ba | sed -n '1,180p'Repository: boostorg/website-v2 Length of output: 8883 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
from html.parser import HTMLParser
html = """<form method="post" action="/admin/user/1/change/">
<input name="csrfmiddlewaretoken" value="token">
<form method="post" action="/refresh/">
<button type="submit">Refresh</button>
</form>
<input name="email" value="a@example.com">
</form>"""
class P(HTMLParser):
def __init__(self):
super().__init__()
self.stack = []
self.events = []
def handle_starttag(self, tag, attrs):
self.events.append(("start", tag, dict(attrs), tuple(self.stack)))
self.stack.append(tag)
def handle_endtag(self, tag):
self.events.append(("end", tag, tuple(self.stack)))
if tag in self.stack:
self.stack.remove(tag)
p = P()
p.feed(html)
for event in p.events:
print(event)
PYRepository: boostorg/website-v2 Length of output: 687 Remove the nested Django renders 🤖 Prompt for AI Agents |
||
| <span style="margin-left: 10px; color: #666; font-size: 13px;"> | ||
| {% trans "Queues a background task to fetch this user's Boost org activity from GitHub." %} | ||
| </span> | ||
| </div> | ||
| {% elif original and not original.github_username %} | ||
| <div class="submit-row"> | ||
| <span style="color: #888; font-size: 13px;"> | ||
| {% trans "No GitHub username set - cannot fetch activity." %} | ||
| </span> | ||
| </div> | ||
| {% endif %} | ||
| {% endblock %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| {% comment %} | ||
| GitHub activity card plus its sync status line. | ||
|
|
||
| While a background refresh is running this element re-requests itself and | ||
| swaps itself out. Each response decides whether polling continues: the | ||
| hx-* attributes are only rendered while still refreshing and under the | ||
| attempt cap, so the chain stops on its own once the data lands (or once we | ||
| give up and ask the user to reload). | ||
|
|
||
| Inputs: | ||
| data: dict, required - from users.profile_cards.github_activity_card | ||
| attempt: int, required - how many polls have happened so far | ||
| poll_exhausted: bool, required - whether the attempt cap has been reached | ||
| poll_url: str, required - url of the fragment endpoint | ||
| poll_interval: int, required - seconds between polls | ||
| {% endcomment %} | ||
| <div id="github-activity-card" | ||
| {% if data.refreshing and not poll_exhausted %} | ||
| hx-get="{{ poll_url }}?attempt={{ next_attempt }}" | ||
| hx-trigger="load delay:{{ poll_interval }}s" | ||
| hx-swap="outerHTML" | ||
| {% endif %}> | ||
| {% include 'v3/includes/_markdown_card.html' with title=data.title markdown=data.markdown_text button_url=data.button_url button_label=data.button_label %} | ||
| {% include 'v3/includes/_github_activity_status.html' with refreshing=data.refreshing last_synced=data.last_synced poll_exhausted=poll_exhausted only %} | ||
| </div> |
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.
Should we add this to env.template and docs/env_vars.md for completeness?
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.
Done