-
-
Notifications
You must be signed in to change notification settings - Fork 8
Update Jira workflow to match API changes #71
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
Conversation
|
Warning Rate limit exceeded@igorpecovnik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 46 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds a push trigger to the existing workflow (keeps repository_dispatch), grants job-level Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels: Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/generate-jira-excerpt.yml (2)
4-4: Consider specifying which branches trigger the workflow.The workflow will now run on every push to any branch. Consider limiting it to specific branches (e.g., main, develop) to avoid unnecessary runs on feature branches.
Apply this diff to limit the workflow to main branch pushes:
on: - push: + push: + branches: [main] repository_dispatch: types: ["Jira update"]
95-96: Consider adding more issue types.The icon mapping only covers 4 issue types. Consider adding mappings for other common Jira issue types like "Improvement", "Sub-task", etc., to provide better visual representation.
Apply this diff to expand the icon mapping:
- def icon(itype): - return {"Bug":"🐞","Task":"📋","Story":"📖","Epic":"🧩"}.get(str(itype),"") + def icon(itype): + return { + "Bug": "🐞", + "Task": "📋", + "Story": "📖", + "Epic": "🧩", + "Improvement": "⚡", + "Sub-task": "📝" + }.get(str(itype), "")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-jira-excerpt.yml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Get from Armbian Repository
🔇 Additional comments (9)
.github/workflows/generate-jira-excerpt.yml (9)
16-20: LGTM!Proper job-level permissions and environment variable configuration from secrets. The
contents: writepermission is correctly scoped for the git push operation.
29-32: LGTM!Upgrading from Python 3.8 to 3.10 is a good choice for better performance and language features, while maintaining compatibility.
37-53: LGTM!The inline Python script setup with proper imports, environment variable validation, and authentication configuration is well-structured. Good error handling for missing credentials.
54-71: LGTM!The release bucket calculation logic correctly handles the quarterly release schedule (02, 05, 08, 11) with proper year transitions and edge cases.
72-94: LGTM!Excellent pagination implementation with proper error handling, timeout configuration, and robust termination conditions. The function correctly handles partial pages and API errors.
98-115: LGTM!The render function properly handles HTML escaping, file I/O, and generates well-structured HTML output. Good defensive programming with null checks on nested dictionary access.
116-128: LGTM!The render calls correctly use the calculated release buckets and appropriate JQL queries with proper sorting. The different sort orders (priority vs priority DESC) are intentional and correct.
138-142: LGTM!Good improvements: using local git config instead of global, and fixing the commit message spelling from "indes" to "index". The conditional commit logic prevents empty commits.
34-128: Verify inline heredoc extraction and Jira access
- YAML is valid; the job sets permissions: contents: write and maps JIRA_EMAIL/JIRA_TOKEN from secrets in .github/workflows/generate-jira-excerpt.yml.
- Your python compile check failed because the heredoc delimiter was not stripped; extract and validate the embedded script with:
sed -n "/python - <<'PY'/, /^PY$/p" .github/workflows/generate-jira-excerpt.yml | sed '1d;$d' > /tmp/jira_script.py
python -m py_compile /tmp/jira_script.py && echo "✓ Inline Python script syntax is valid"- Cannot verify Jira API authentication or that jira-current.html / jira-next.html are actually created without running the workflow or providing secrets — run the extracted script locally with JIRA_EMAIL and JIRA_TOKEN exported, or trigger the workflow in GitHub (with secrets) and inspect the job workspace/artifacts.
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.
Actionable comments posted: 2
🧹 Nitpick comments (8)
.github/workflows/generate-jira-excerpt.yml (8)
24-27: Branch handling is brittle; "git checkout data" may fail if branch is missing.Either check out the target branch in the checkout step or create/switch robustly in the commit step.
Option A (checkout the data branch up-front):
- name: Checkout repository uses: actions/checkout@v5 with: fetch-depth: 0 - path: armbian.github.io + path: armbian.github.io + ref: dataThen drop
git checkout data:- git checkout dataOption B (robust switch in the commit step):
- git checkout data + git fetch origin + if git show-ref --verify --quiet refs/heads/data; then + git switch data + else + git switch -c data + fiAlso applies to: 135-147
29-33: Enable pip caching for speed/determinism.- - name: Setup Python + - name: Setup Python uses: actions/setup-python@v6 with: python-version: "3.10" + cache: 'pip'
34-37: Pin requests to a safe range.Unpinned installs can break the workflow. Pin a ceiling before 3.x unless tested.
- python -m pip install --upgrade pip - pip install requests + python -m pip install --upgrade pip + pip install "requests>=2.31,<3"
77-99: Add retry with backoff for 429/5xx to handle Jira throttling.- r = requests.get(SEARCH_URL, params=params, headers=HEADERS, auth=AUTH, timeout=30) - if r.status_code >= 400: + for attempt in range(5): + r = requests.get(SEARCH_URL, params=params, headers=HEADERS, auth=AUTH, timeout=30) + if r.status_code in (429, 502, 503, 504): + import time + time.sleep(min(60, (2**attempt))) + continue + break + if r.status_code >= 400: print(f"Jira API error {r.status_code}: {r.text}", file=sys.stderr) sys.exit(1)
100-102: Minor HTML polish: avoid escaping emojis and show empty state.- def icon(itype): - return {"Bug":"🐞","Task":"📋","Story":"📖","Epic":"🧩"}.get(str(itype),"") + def icon(itype): + return {"Bug":"🐞","Task":"📋","Story":"📖","Epic":"🧩"}.get(str(itype), "")- for it in issues: + if not issues: + f.write("<li>No matching issues.</li>\n") + for it in issues: ... - f.write( - f'<li><a href="{BASE}/browse/{key}">{html.escape(key)}</a> ' - f'{html.escape(icon(itype))} {html.escape(itype)}: ' + f.write( + f'<li><a href="{BASE}/browse/{key}">{html.escape(key)}</a> ' + f'{icon(itype)} {html.escape(itype)}: ' f'{html.escape(summary)} — Assigned to: {html.escape(assignee)}</li>\n' )Also applies to: 114-118
121-132: Stabilize ordering for consistent diffs.- ORDER BY priority + ORDER BY priority DESC, updated DESCand
- ORDER BY priority DESC + ORDER BY priority DESC, updated DESC
8-10: Consider cancelling in-flight runs to prevent overlap.If this runs frequently, set
cancel-in-progress: trueunless overlap is desired.concurrency: group: redirector - cancel-in-progress: false + cancel-in-progress: true
59-76: Release bucket logic in December may be surprising.In December (
m=12) current bucket becomes next year's "02". If you intend November ("11") to remain current through year-end, adjust the logic.Proposed tweak:
-elif m <= 11: +elif m <= 11: cy, cm, ny, nm = y, "11", y+1, "02" -else: - cy, cm, ny, nm = y+1, "02", y+1, "05" +else: # m == 12 + cy, cm, ny, nm = y, "11", y+1, "02"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-jira-excerpt.yml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Get from Armbian Jira
🔇 Additional comments (3)
.github/workflows/generate-jira-excerpt.yml (3)
16-21: Good: least-privilege for GITHUB_TOKEN and secrets via env.
143-146: Local git config is correct for CI.
24-24: Confirm action versions exist/stable (actions/checkout@v5, actions/setup-python@v6) — OK.
Both are published stable major releases: actions/checkout v5.0.0 (released Aug 11, 2025) and actions/setup-python v6.0.0 (released Sep 4, 2025).
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.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.github/workflows/generate-jira-excerpt.yml (2)
4-5: Scope push trigger to avoid self-trigger loops and noise.Unscoped push will re-run after pushing to branch "data". Exclude data and/or restrict to main.
on: - push: + push: + branches: + - main + paths-ignore: + - 'data/**' repository_dispatch:
47-51: Jira endpoint path is wrong; use /rest/api/3/search./rest/api/3/search/jql 404s. Fix URL.
-SEARCH_URL = f"{BASE}/rest/api/3/search/jql" +SEARCH_URL = f"{BASE}/rest/api/3/search"
🧹 Nitpick comments (3)
.github/workflows/generate-jira-excerpt.yml (3)
71-90: Verify release-bucket logic for December.In December (m == 12) current_fix becomes next year’s 02, skipping 11. Confirm this matches intended cadence; otherwise map Dec to current=11, next=02 of next year.
120-121: Make sorting consistent with “Sorted by priority” heading.Current list orders ascending (lowest first). Use desc like the “next” query.
-issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by Priority') +issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by priority desc')
39-43: Optional: Write files directly into the repo to avoid cross-path moves.Set working-directory and emit to data/ directly; simplifies later mv steps.
- - name: Pull from Jira (inline; same HTML as before) - shell: bash - run: | + - name: Pull from Jira (inline; same HTML as before) + working-directory: ${{ github.workspace }}/armbian.github.io + shell: bash + run: | python - <<'PY' # Emits identical structure to the previous pull-from-jira.py import os, sys, html, requests from datetime import datetime @@ - def write_current(): - with open("jira-current.html", "w", encoding="utf-8") as f: + def write_current(): + os.makedirs("data", exist_ok=True) + with open("data/jira-current.html", "w", encoding="utf-8") as f: @@ - def write_next(): - with open("jira-next.html", "w", encoding="utf-8") as f: + def write_next(): + os.makedirs("data", exist_ok=True) + with open("data/jira-next.html", "w", encoding="utf-8") as f:And then drop the mv lines in the commit step.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-jira-excerpt.yml(2 hunks)
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 0
♻️ Duplicate comments (2)
.github/workflows/generate-jira-excerpt.yml (2)
46-48: Fix Jira search endpoint: remove trailing “/jql”.Current path 404s; API is /rest/api/3/search.
Apply:
-SEARCH_URL = f"{BASE}/rest/api/3/search/jql" +SEARCH_URL = f"{BASE}/rest/api/3/search"
149-161: Ensure local ‘data’ branch exists and set upstream before push.git checkout data can fail on a fresh runner; also set upstream to avoid push errors.
cd armbian.github.io - git checkout data + git fetch origin data || true + git show-ref --verify --quiet refs/heads/data || git branch --track data origin/data 2>/dev/null || git branch data + git checkout data mkdir -p data/ mv ${{ github.workspace }}/jira-current.html data/ mv ${{ github.workspace }}/jira-next.html data/ git config user.name "github-actions" git config user.email "github-actions@github.com" git add data/. - git diff --cached --quiet || git commit -m "Update WEB index files" - git push + git diff --cached --quiet || git commit -m "Update WEB index files" + # ensure remote/upstream is set + git rev-parse --abbrev-ref --symbolic-full-name @{u} >/dev/null 2>&1 || git push -u origin data + git push
🧹 Nitpick comments (7)
.github/workflows/generate-jira-excerpt.yml (7)
15-19: Job permissions and secret scoping look appropriate.contents: write is required for pushing; exposing JIRA_EMAIL/JIRA_TOKEN at job scope is fine. Consider step‑level env to narrow blast radius, but not blocking.
28-31: Python 3.10 pin is fine; confirm it’s intentional.ubuntu-24.04 ships newer Python; if no 3.10‑specific need, you could drop setup-python to reduce time. Optional.
95-112: Add basic retry/backoff for 429/5xx to harden pagination.Single-shot GET can flake on Jira Cloud; add small retries with backoff and handle 429 Retry-After.
-def fetch_all(jql: str, page=100): +def fetch_all(jql: str, page=100): start = 0 out = [] while True: - params = {"jql": jql, "fields": FIELDS, "startAt": start, "maxResults": page} - r = requests.get(SEARCH_URL, params=params, headers=HEADERS, auth=AUTH, timeout=30) - if r.status_code >= 400: - print(f"Jira API error {r.status_code}: {r.text}", file=sys.stderr) - sys.exit(1) + params = {"jql": jql, "fields": FIELDS, "startAt": start, "maxResults": page} + # simple retry/backoff + for attempt in range(5): + r = requests.get(SEARCH_URL, params=params, headers=HEADERS, auth=AUTH, timeout=30) + if r.status_code in (429, 500, 502, 503, 504): + delay = int(r.headers.get("Retry-After", 1)) if r.status_code == 429 else (2 ** attempt) + time.sleep(min(delay, 10)) + continue + break + if r.status_code >= 400: + print(f"Jira API error {r.status_code}: {r.text}", file=sys.stderr) + sys.exit(1) data = r.json() chunk = data.get("issues", []) out.extend(chunk) total = data.get("total", len(out)) if not chunk or start + len(chunk) >= total: break start += len(chunk) return out
117-117: Fix typo in user-facing text (“reqests” → “requests”).Minor UI polish.
- f.write('<p>\n##### <a href="https://github.com/armbian/community/issues?q=is%3Aopen+is%3Aissue+label%3A%22Ready+for+merge%22">Check if you can review code that already waits at Pull reqests</a>\n</p>\n') + f.write('<p>\n##### <a href="https://github.com/armbian/community/issues?q=is%3Aopen+is%3Aissue+label%3A%22Ready+for+merge%22">Check if you can review code that already waits at Pull requests</a>\n</p>\n')
119-119: Prefer statusCategory != Done over literal status names.More robust across custom workflows.
-issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by Priority') +issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and statusCategory != Done order by priority')
135-136: Align sort order between current/next lists.One uses ascending, the other explicit desc. Pick one for consistency.
-issues = fetch_all(f'project=AR and fixVersion="{next_fix}" and status!="Done" and status!="Closed" order by priority desc') +issues = fetch_all(f'project=AR and fixVersion="{next_fix}" and statusCategory != Done order by priority')
130-134: Header mixes HTML and Markdown markers.Use consistent HTML headings for cleaner rendering.
- f.write('\n<h2>\n') - f.write("# Planned for " + next_fix + " and further \n\nSorted by priority\n\n") - f.write('</h2>\n\n') + f.write(f'\n<h2>Planned for {html.escape(next_fix)} and further</h2>\n<p>Sorted by priority</p>\n')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/workflows/generate-jira-excerpt.yml(2 hunks)scripts/pull-from-jira.py(0 hunks)
💤 Files with no reviewable changes (1)
- scripts/pull-from-jira.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Get from Armbian Repository
🔇 Additional comments (1)
.github/workflows/generate-jira-excerpt.yml (1)
33-37: Minimal deps OK.requests is sufficient; good to have pip upgraded.
e83fcc8 to
093cbe9
Compare
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.
Actionable comments posted: 1
♻️ Duplicate comments (3)
.github/workflows/generate-jira-excerpt.yml (3)
4-5: Scope push trigger to avoid self-trigger loops and noise.Unscoped push will retrigger when this job pushes to branch "data". Exclude data/ and/or restrict to main.
on: - push: + push: + branches: + - main + paths-ignore: + - 'data/**' repository_dispatch: types: ["Jira update"]
47-51: Fix Jira API endpoint: use /rest/api/3/search (not /search/jql).Current path 404s; requests will always fail.
-SEARCH_URL = f"{BASE}/rest/api/3/search/jql" +SEARCH_URL = f"{BASE}/rest/api/3/search"
150-163: Make checkout of ‘data’ branch robust.Plain git checkout data can fail if the local branch doesn’t exist. Fetch and create tracking first.
- name: Commit changes if any shell: bash run: | cd armbian.github.io - git checkout data + git fetch origin data || true + git show-ref --verify --quiet refs/heads/data || git branch --track data origin/data + git checkout data mkdir -p data/ mv ${{ github.workspace }}/jira-current.html data/ mv ${{ github.workspace }}/jira-next.html data/ git config user.name "github-actions" git config user.email "github-actions@github.com" git add data/. git diff --cached --quiet || git commit -m "Update WEB index files" git push
🧹 Nitpick comments (1)
.github/workflows/generate-jira-excerpt.yml (1)
120-120: Standardize JQL ordering.Use consistent “order by priority desc” in both queries so highest priority appears first.
- issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by Priority') + issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by priority desc')Also applies to: 136-136
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-jira-excerpt.yml(2 hunks)
093cbe9 to
4dfbc62
Compare
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.
Actionable comments posted: 0
♻️ Duplicate comments (4)
.github/workflows/generate-jira-excerpt.yml (4)
4-5: Scope push trigger to avoid self-retrigger loops on branch "data".Unscoped push will re-run when this job pushes to data. Exclude data and/or restrict to main.
Apply:
on: - push: + push: + branches: + - main + paths-ignore: + - 'data/**'
150-163: Harden checkout to ensure local “data” exists before use.Plain git checkout data can fail if the branch isn’t present locally.
Apply:
cd armbian.github.io - git checkout data + git fetch origin data || true + git show-ref --verify --quiet refs/heads/data || git branch --track data origin/data || git checkout -b data + git checkout data
48-48: Fix Jira search endpoint: “/search/jql” 404s; use “/rest/api/3/search”.Current path will fail and abort the job.
Apply:
- SEARCH_URL = f"{BASE}/rest/api/3/search/jql" + SEARCH_URL = f"{BASE}/rest/api/3/search"
117-120: Broken string concatenation and typo in HTML header; variable not injected.current_fix is written literally due to quotes; also “reqests” typo. Make it a real concatenation (or f-string) and fix spelling.
Apply:
- f.write('\n\n<div style="color: #ccc;"><h1 style="color: #ccc;"> Should be completed in " + current_fix + "</h1>Sorted by priority</div>\n') - f.write('\n<div style="color: #ccc;"><h5 style="color: #ccc;"><a href="https://github.com/armbian/build/pulls?q=is%3Apr+is%3Aopen+label%3A%22Needs+review%22">Check if you can review code that already waits at Pull reqests</a></h5></div>\n') + f.write('\n\n<div style="color: #ccc;"><h1 style="color: #ccc;"> Should be completed in ' + current_fix + '</h1>Sorted by priority</div>\n') + f.write('\n<div style="color: #ccc;"><h5 style="color: #ccc;"><a href="https://github.com/armbian/build/pulls?q=is%3Apr+is%3Aopen+label%3A%22Needs+review%22">Check if you can review code that already waits at Pull requests</a></h5></div>\n')Optional (clearer):
- f.write('\n\n<div style="color: #ccc;"><h1 style="color: #ccc;"> Should be completed in ' + current_fix + '</h1>Sorted by priority</div>\n') + f.write(f'\n\n<div style="color: #ccc;"><h1 style="color: #ccc;"> Should be completed in {current_fix}</h1>Sorted by priority</div>\n')
🧹 Nitpick comments (2)
.github/workflows/generate-jira-excerpt.yml (2)
120-120: Make current list ordering consistent: use “priority desc”.The “current” query sorts by default (ascending) while “next” uses desc. Align to desc for both.
Apply:
- issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by Priority') + issues = fetch_all(f'project=AR and fixVersion="{current_fix}" and status!="Done" and status!="Closed" order by priority desc')
39-46: Optional: write HTML directly into repo path to avoid cross-dir mv.Simplify by chdir before Python or writing to armbian.github.io/ directly; reduces path coupling.
Example:
- - name: Pull from Jira (inline; same HTML as before) - shell: bash - run: | - python - <<'PY' + - name: Pull from Jira (inline; same HTML as before) + working-directory: armbian.github.io + shell: bash + run: | + python - <<'PY' ... - with open("jira-current.html", "w", encoding="utf-8") as f: + with open("data/jira-current.html", "w", encoding="utf-8") as f: ... - with open("jira-next.html", "w", encoding="utf-8") as f: + with open("data/jira-next.html", "w", encoding="utf-8") as f:And drop the later mv lines.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-jira-excerpt.yml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Get from Armbian Jira
308589e to
7edf74e
Compare
7edf74e to
bb07dbc
Compare
armbianworker
left a comment
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.
Output looks well: https://www.armbian.com/participate/
No description provided.