Add Jira Cloud domain skill (REST via in-tab fetch, multi-site discovery, traps) - #514
Open
ardasisbot wants to merge 1 commit into
Open
Add Jira Cloud domain skill (REST via in-tab fetch, multi-site discovery, traps)#514ardasisbot wants to merge 1 commit into
ardasisbot wants to merge 1 commit into
Conversation
…raps Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="agent-workspace/domain-skills/jira/scraping.md">
<violation number="1" location="agent-workspace/domain-skills/jira/scraping.md:14">
P1: The `js()` function in this codebase awaits Promises (`await_promise=True` in the CDP Runtime.evaluate call), so the entire `window.__r` + polling pattern documented here is built on a false premise. `js()` will wait for the fetch Promise to resolve and return its value. The pattern shown overcomplicates the approach. Instead, the fetch can return the JSON result directly in a single `js()` call, making the pattern much simpler and more reliable — no polling, no window stash, no race conditions.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| ## The pattern | ||
|
|
||
| Open a tab on the Jira site, then fetch same-origin with `credentials: "include"`. | ||
| `js()` doesn't await promises, so stash the result on `window` and poll: |
Contributor
There was a problem hiding this comment.
P1: The js() function in this codebase awaits Promises (await_promise=True in the CDP Runtime.evaluate call), so the entire window.__r + polling pattern documented here is built on a false premise. js() will wait for the fetch Promise to resolve and return its value. The pattern shown overcomplicates the approach. Instead, the fetch can return the JSON result directly in a single js() call, making the pattern much simpler and more reliable — no polling, no window stash, no race conditions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At agent-workspace/domain-skills/jira/scraping.md, line 14:
<comment>The `js()` function in this codebase awaits Promises (`await_promise=True` in the CDP Runtime.evaluate call), so the entire `window.__r` + polling pattern documented here is built on a false premise. `js()` will wait for the fetch Promise to resolve and return its value. The pattern shown overcomplicates the approach. Instead, the fetch can return the JSON result directly in a single `js()` call, making the pattern much simpler and more reliable — no polling, no window stash, no race conditions.</comment>
<file context>
@@ -0,0 +1,55 @@
+## The pattern
+
+Open a tab on the Jira site, then fetch same-origin with `credentials: "include"`.
+`js()` doesn't await promises, so stash the result on `window` and poll:
+
+```python
</file context>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
domain-skills/jira/scraping.mdfor Jira Cloud (*.atlassian.net).Field-tested findings:
/rest/api/3/search/jqlsame-origin with session cookies — thejs()+ window-stash + poll pattern is included sincejs()doesn't await promises.POST /gateway/api/available-sitesenumerates all Atlassian sites the account can reach — critical because the obvious site can be empty while the real tickets live on a sibling site, and cookies are per-subdomain (open a tab on the other site before fetching)./jira/your-workredirects after load (clears injected window state), empty results and JQL errors both return HTTP 200, service-desk projects are plain-JQL searchable, old/rest/api/3/searchis deprecated in favor of/search/jql.🤖 Generated with Claude Code
Summary by cubic
Adds a Jira Cloud domain skill doc for
*.atlassian.netthat uses same-origin REST via in-tabfetchwith session cookies for fast JQL access, plus multi-site discovery to avoid empty results. Skips DOM scraping and outlines key traps.fetchpattern withcredentials: "include"and window-stash + polling sincejs()doesn’t await promises.POST /gateway/api/available-sites; cookies are per subdomain — open a tab on the target site first./rest/api/3/search/jql;/jira/your-workredirects; empty/JQL-error responses can be HTTP 200; service-desk projects are searchable with plain JQL.Written for commit b533f2a. Summary will update on new commits.