Skip to content

feat(jirapoll)!: remove the per-issue lock and check write access first - #9853

Merged
waynesun09 merged 24 commits into
fullsend-ai:mainfrom
guyoron1:feat/jirapoll-remove-lock
Dec 3, 2026
Merged

waynesun09 merged 24 commits into
fullsend-ai:mainfrom
guyoron1:feat/jirapoll-remove-lock

Conversation

@guyoron1

@guyoron1 guyoron1 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The jira-poll driver stops reading and writing the per-issue lock and instead confirms it can write to an issue before reading its comments and history. Implements ADR 0085 Decision item 1. The managed GitHub workflow and GitLab schedule already run one cycle at a time per repository, so the lock never coordinated anything there.

Stacked on #9852. #9758 has merged, so the base is now main. #9852 is merged into this branch because the two edit the same paragraphs of the Jira guide, so merge #9852 first. Jira: AISDLC-876. The rest of the AISDLC-826 main path (877–882) builds on this.

Related Issue

Part of #9751

Changes

  • internal/jirapoll/lock.go: attemptLock, releaseLock, readLock, isLockStale and the lock key go. New checkWriteAccess writes fullsend.poll.{owner}.{repo}.writeCheck (GitLab: the fullsend.poll.gitlab.* namespace) with the check time; nothing reads it.
  • internal/jirapoll/poller.go: filterLocked becomes filterActive, the ADR 0160 activity filter alone; it no longer returns an error or an unlocked count. processIssue runs the write check first; a failure returns check write access to <KEY>: ..., so Run warns and goes on, and the existing all-failed guard fails a cycle in which every selected issue fails. The cycle UUID, jitter sleep and uuid import go; poll complete drops its unlocked count.
  • internal/jirapoll/types.go: Options.StaleThreshold and LockValue go. No CLI flag or config key set either.
  • Tests: the lock tests go. New TestRunIgnoresLegacyLock (a live lock from an older version is not honoured, not modified, not deleted) and TestRunWriteAccessCheck (one denied issue: no reads, no records, a WARNING, the other issue dispatched; all denied: the all-failed error). Key tests now check the writeCheck key. TestRunSkipsIdleCandidates still asserts idle candidates cost no property write.
  • Docs: the Jira guide's poll coordination, scheduled workflow, multi-repo and cost sections; the custom poller example gains a concurrency group, since overlapping cycles now dispatch twice. The Troubleshooting table gains a row for duplicate dispatches from overlapping cycles and a row for a failed write check, with the permission and the token scope the write needs (from the review of 30 November). docs/architecture.md is not touched: main already describes the lock removal there (ADR 0085).
  • Review follow-up: a denied issue keeps its lastCheck unset; the write-check property holds an RFC 3339 time and a served issue costs two property writes; TestRenderJiraPollCaller pins the managed poll job's concurrency group; the filter tests are renamed to FilterActive; the guide says the write-check property stays on the issue and that the concurrency group covers one workflow file.
  • After the base took main (chore(jirapoll): merge main into feat/jirapoll-skip-idle #9899): two comments that came with the merge still named the lock (uniqueIssues and a multi-project test); they no longer do. Nor does the Jira row of the capability table in docs/normative/entity-execution-cli/v1/README.md, which also came with main, or the comment of TestPropertyKey_DottedSlugsDoNotCollide.
  • After the base took main a second time (2 December): the merge keeps the no-match warning that main added to the poller (fix(#9503)!: dispatch built-in agents from Jira without registration #9831). Nothing else changes here.
  • After feat(jirapoll): skip Jira poll candidates with no new activity #9758 merged (3 December): main is merged in, through fix(jirapoll): treat an unparseable lastCheck as unset #9852, so that the checks main requires run on this branch. No conflicts, and nothing else changes here.
  • Review follow-up (3 December): DeleteEntityProperty leaves the poller's JiraClient interface, so a delete no longer compiles; TestRunIgnoresLegacyLock fails if the legacy lock is read; TestPollJobResourceGroup pins the GitLab poll job's resource group; docs/architecture.md no longer calls the lock's removal a target state, and the normalized-entity spec names the write-check property instead of the lock.

Notes for review:

  • How to check write access. ADR 0085 leaves it to the implementation. I chose one real property write rather than GET /mypermissions?permissions=EDIT_ISSUES: a scoped or OAuth token can hold the permission and still lack the write scope, which is the case the check exists to catch (dispatch, then fail the checkpoint commit). Atlassian's API spec gives read:jira-work as the OAuth scope for mypermissions and write:jira-work for setting an issue property. The cost is one write per selected issue, down from the lock's write, read-back, delete and 0.5–1.5 s sleep. The trade-off is one leftover property per processed issue, overwritten on each look; deleting it would cost a second call per issue every cycle.
  • Breaking. Marked !: a scheduler other than the managed ones that lets cycles for one repository overlap now dispatches the same requests twice. The commit carries a BREAKING CHANGE: trailer; the adopter notice is AISDLC-884 (docs(jira-poll): say what changes when an adopter upgrades the poller #9918).
  • ADR 0063 is left as written; ADR 0085 (on main) records which parts it supersedes. Code comments cite ADR 0085 by number; the ADR file came to this branch with main (chore(jirapoll): merge main into feat/jirapoll-skip-idle #9899).

Testing

  • make lint passes (stage changes first, then run)
  • Tests added/updated for new or modified logic
go test -race -count=1 ./internal/jirapoll/ ./pkg/behaviourtest/drivers/jiramock/
go test -race -count=1 -run 'Jira|jira' ./internal/cli/ ./pkg/behaviourtest/... ./internal/poll/ ./internal/config/ ./internal/scaffold/

All pass.

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

A lastCheck entity property that is not a timestamp made loadLastCheck
return an error, so processIssue failed the issue on every pick and
never saved a valid value. The activity filter keeps such an issue
active, so when it was the only active candidate every quiet cycle
ended in "all 1 selected issues failed to process".

Treat a value that is not a JSON string holding an RFC 3339 timestamp
as unset, as a future value already is. The issue gets one first-poll
look bounded by the backfill window, which saves a valid lastCheck.
Processing logs a WARNING naming the issue without the stored value,
and the filter's per-cycle line names such candidates. A failed read
is still an error.

Amend ADR 0160 Decision item 1, which said the per-issue error path
reports such a value, and update the Jira guide's security note.

Fixes fullsend-ai#9766

Signed-off-by: guy oron <goron@redhat.com>
Implements ADR 0085 Decision item 1. The managed GitHub workflow and
the managed GitLab schedule run one poll cycle at a time per
repository, so the lock never coordinated anything there.

- The driver neither reads nor writes the lock property and ignores
  locks left by earlier versions. filterLocked becomes filterActive,
  the activity filter alone. attemptLock, releaseLock, readLock,
  isLockStale, LockValue, Options.StaleThreshold and the jitter
  sleep go.
- Before reading an issue's comments and history, processIssue
  writes a writeCheck entity property to confirm the credential can
  write, as the lock write did. An issue that fails yields no records
  and the driver warns and goes on; a cycle in which every selected
  issue fails ends in the existing all-failed error. Idle candidates
  still cost no write.
- The "poll complete" line drops its unlocked count.
- The Jira guide, architecture overview and custom poller example
  describe the one-cycle-per-repository rule; the example gains a
  concurrency group.

BREAKING CHANGE: the jira-poll driver no longer locks issues. A
scheduler other than the managed GitHub workflow or GitLab schedule
must keep two poll cycles for one repository from overlapping, for
example with a GitHub Actions concurrency group; overlapping cycles
dispatch the same requests twice. Lock properties left by earlier
versions are ignored and can be deleted.

Signed-off-by: guy oron <goron@redhat.com>
@guyoron1
guyoron1 requested a review from a team as a code owner November 25, 2026 07:23
@qodo-code-review

qodo-code-review Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

feat(jirapoll)!: remove per-issue lock and check write access first

✨ Enhancement 🐞 Bug fix 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Removes the per-issue Jira lock. Cycles now rely on a per-repo concurrency group, and overlapping
 cycles duplicate dispatches.
• Each selected issue first writes a writeCheck property. A denied write skips that issue and fails
 the cycle only if all fail.
• Non-timestamp lastCheck values are treated as unset, so a garbage value no longer blocks an issue
 (#9766). Docs and ADR 0160 updated to match.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The poll cycle, checkpoint state, event conversion and downstream dispatch records form one bounded Jira integration.
  • Lock removal and caller serialization are coordination mechanisms within this end-to-end behavior, not independent functional scopes.
  • Malformed checkpoint handling changes when the same Jira polling and dispatch integration examines activity; it does not independently reach an unrelated functional subsystem.
  • The write preflight is a guard within the same Jira polling-to-dispatch capability; it does not create a separate functional scope.
Sources

internal/jirapoll/poller.go[85-87]

// Run executes a single poll cycle per ADR 0063. The caller must keep two
// cycles for one target repository from overlapping: with no lock, they
// would dispatch the same requests twice (ADR 0085, Decision item 1).

internal/jirapoll/poller.go[582-592]

// processIssue confirms write access, detects changes, converts, routes,
// and dispatches. It returns the checkpoint value the caller should advance
// lastCheck to once the dispatch file has been durably written (zero if
// there is nothing to advance) — it does not commit the checkpoint itself.
func (p *Poller) processIssue(ctx context.Context, issue jira.Issue) (time.Time, error) {
	// Confirm write access before reading the issue's comments and history
	// (ADR 0085, Decision item 1). A failure yields no records: Run warns
	// and goes on, and a cycle in which every issue fails ends in an error.
	if err := p.checkWriteAccess(ctx, issue.Key); err != nil {
		return time.Time{}, fmt.Errorf("check write access to %s: %w", issue.Key, err)
	}
Behavioral complexity 🔴 High 🧩 Concurrent ordering, Coordinated invariants

  • Before, the poller attempted per-issue coordination; after, callers must serialize complete cycles.
  • New correctness condition: every scheduler capable of invoking a target repository poll must share a serialization boundary, otherwise identical checkpoint and activity windows can dispatch twice.
  • The managed template's resource-group test verifies its own queueing boundary, but independent workflows or schedulers remain outside that boundary.
Sources

internal/jirapoll/poller.go[85-87]

// Run executes a single poll cycle per ADR 0063. The caller must keep two
// cycles for one target repository from overlapping: with no lock, they
// would dispatch the same requests twice (ADR 0085, Decision item 1).
Potential damage 🟡 Medium 🩹 Incorrect results

  • Overlapping cycles can emit duplicate requests for the same Jira activity.
  • The managed workflow has a queueing boundary, but arbitrary callers and separate workflows are not universally serialized.
  • Reverting restores lock-based coordination for future cycles, but emitted duplicate requests and downstream effects require cancellation, deduplication or manual repair.
Sources

internal/jirapoll/poller.go[85-87]

// Run executes a single poll cycle per ADR 0063. The caller must keep two
// cycles for one target repository from overlapping: with no lock, they
// would dispatch the same requests twice (ADR 0085, Decision item 1).
Assessed commit f821b61
Diagram

graph TD
  A["Poll cycle"] --> B["filterActive"] --> C["Select N issues"] --> D["checkWriteAccess"] --> E["Read comments and history"] --> F["Dispatch records"]
  D --> G[("writeCheck property")]
  E --> H[("lastCheck property")]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep the lock as a best-effort guard
  • ➕ Narrows the duplicate-dispatch window for ad hoc or second-workflow runs
  • ➕ No change to existing key semantics
  • ➖ No compare-and-swap, so the race remains
  • ➖ Stale-lock reclaim and release logic stays in the driver
  • ➖ Two extra property calls per issue for little protection
2. Enforce single-flight with a Jira-side or forge-side mutex
  • ➕ True mutual exclusion across any scheduler
  • ➖ Needs a new coordination service or external state store
  • ➖ Far larger change than this PR

Recommendation: Removing the lock is sound. Jira entity properties have no compare-and-swap, so the old lock never guaranteed mutual exclusion. The managed GitHub workflow and GitLab schedule already serialize cycles, so the lock added cost without protection there. The write check keeps the one useful property of the lock: a credential that cannot write fails early, before dispatches. Keeping the lock as a best-effort guard would retain the stale-lock and clobber-race complexity and still not provide exclusion.

Files changed (15) +322 / -646

Enhancement (3) +84 / -272
lock.goDrop lock functions; add writeCheck key and checkWriteAccess +38/-156

Drop lock functions; add writeCheck key and checkWriteAccess

• Removes attemptLock, releaseLock, readLock and isLockStale. Adds writeCheckPropertyKey and checkWriteAccess, which writes the RFC 3339 check time. Non-timestamp lastCheck values now yield clampInvalid and are treated as unset.

internal/jirapoll/lock.go

poller.goReplace locked filter with activity-only filter and add write check +46/-104

Replace locked filter with activity-only filter and add write check

• filterLocked becomes filterActive, with no error or unlocked count. processIssue runs checkWriteAccess first and reports its failure. The cycle UUID, jitter sleep and uuid import are removed, and the poll-complete log drops its unlocked field. The invalid-checkpoint clamp is added to the cycle log.

internal/jirapoll/poller.go

types.goRemove StaleThreshold and LockValue types +0/-12

Remove StaleThreshold and LockValue types

• Deletes Options.StaleThreshold and the LockValue struct. No CLI flag or config key was bound to them.

internal/jirapoll/types.go

Tests (5) +193 / -355
poller_test.goReplace lock tests with legacy-lock and write-access tests +101/-279

Replace lock tests with legacy-lock and write-access tests

• Removes lock, stale-lock and isLockStale tests. Adds TestRunIgnoresLegacyLock, TestRunWriteAccessCheck and TestRunAllSelectedIssuesFailedFailsCycle, plus a writeDeniedClient helper. Key tests now target writeCheck.

internal/jirapoll/poller_test.go

poller_idle_test.goUpdate idle and activity tests for filterActive and invalid lastCheck +71/-61

Update idle and activity tests for filterActive and invalid lastCheck

• Removes the lock-based filter test. Renames the decision test to TestFilterActiveDecision. Replaces the garbage-lastCheck test with one covering three invalid forms, which are each treated as unset.

internal/jirapoll/poller_idle_test.go

gitlab_target_test.goUpdate GitLab key tests to writeCheck namespace +9/-9

Update GitLab key tests to writeCheck namespace

• Asserts that the GitLab and GitHub write-check keys have the expected format and do not collide. Replaces lockKey references with writeCheckKey.

internal/jirapoll/gitlab_target_test.go

multi_project_test.goCount processed issues by write-check property +6/-6

Count processed issues by write-check property

• Counts processed issues by their writeCheck property instead of the removed lock property.

internal/jirapoll/multi_project_test.go

jira_poll_test.goPin poll job concurrency group in scaffold test +6/-0

Pin poll job concurrency group in scaffold test

• Asserts that the managed poll job has a concurrency group of workflow-poll with cancel-in-progress false, since the lock no longer protects overlapping cycles.

internal/scaffold/jira_poll_test.go

Documentation (7) +45 / -19
poll.goUpdate validTargetRepo comment to drop lock wording +1/-1

Update validTargetRepo comment to drop lock wording

• Comment-only change: the entity-property namespace note no longer refers to a lock.

internal/cli/poll.go

poll_jira_gitlab.goUpdate GitLab preflight comment +1/-1

Update GitLab preflight comment

• Comment-only change: the preflight note now says no Jira issue property is touched before authentication.

internal/cli/poll_jira_gitlab.go

poll_jira_gitlab_test.goUpdate GitLab auth-failure test comment +1/-1

Update GitLab auth-failure test comment

• Comment-only change to match the removal of the Jira lock.

internal/cli/poll_jira_gitlab_test.go

jira-integration.mdDocument write-check, drop lock, and add troubleshooting rows +17/-15

Document write-check, drop lock, and add troubleshooting rows

• Updates permissions, poll coordination, the security note, the scheduled-workflow concurrency guidance, and the GitLab and multi-repo sections. Adds troubleshooting rows for duplicate dispatches and failed write checks, including the Edit Issues and write:jira-work scope requirement.

docs/guides/user/jira-integration.md

0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.mdAdd amendment for non-timestamp checkpoints +17/-0

Add amendment for non-timestamp checkpoints

• Adds a 2026-11-25 amendment to ADR 0160. A checkpoint that is not a timestamp is now treated as unset, which replaces the earlier error-path wording.

docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md

custom-poller-example.mdAdd concurrency group to custom poller example +7/-0

Add concurrency group to custom poller example

• Adds a concurrency group with cancel-in-progress false to the example poll job. The comment warns that overlapping cycles dispatch twice and that a second workflow must not poll the same repository.

docs/guides/user/custom-poller-example.md

README.mdRemove lock reference from Jira provider row +1/-1

Remove lock reference from Jira provider row

• Updates the Jira issue row so the driver is described as owning dispatch through checkpoints only.

docs/normative/entity-execution-cli/v1/README.md

@qodo-code-review

qodo-code-review Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Accepted ADR 0160 edit lacks an explicit notice 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The PR description names ADR 0160 only as the source of the activity filter it implements and never
states that the accepted ADR 0160 file was edited or summarises the added amendment. The new
amendment paragraph is listed nowhere in the Changes or Docs notes, so a reviewer of this PR cannot
see from its description that the accepted decision was changed.
Code

docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[R288-291]

+## Amendments
+
+### 2026-11-25: A checkpoint that is not a timestamp is treated as unset (#9766)
+
Relevance

●● Moderate

Rule exists for calling out accepted-ADR edits in PR descriptions, but no direct accept/reject
precedent found; trivial description fix.

PR-#9166

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diff adds ## Amendments and ### 2026-11-25 at lines 288-291 to the accepted ADR 0160. The PR
description's Changes list (internal/jirapoll/poller.go and related items) and its Docs bullets
never mention ADR 0160 being edited, so the rule's requirement for an explicit identifier and
summary of the ADR change is not met.

Rule 59: Call out edits to accepted ADRs in PR descriptions

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR edits the accepted ADR 0160 by adding an Amendments entry, but the PR description does not name ADR 0160 as edited or summarise the change.

## Fix Focus Areas
- docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[288-291]

## Recommended Fix
Add a bullet to the PR description's Changes list, for example: `docs/ADRs/0160-...md`: an Amendments entry (2026-11-25) stating that a `lastCheck` that is not a timestamp is treated as unset. Include the ADR identifier and a one-sentence summary of the change.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Accepted ADR's decision changes in place ✗ Dismissed Rule violation Maintainability

Dismissed as Intentional

Dismissal explanation
The user marked the in-place ADR 0160 amendment as intentional, citing the decision recorded in
#9852.
Description
The new ## Amendments section appended to the accepted ADR 0160 states that Decision item 1's "the
existing per-issue error path reports it as today" is replaced, so an unparseable lastCheck is now
treated as unset instead of failing the issue. This changes what the accepted decision requires, yet
the ADR is edited in place rather than superseded by a new ADR that records the change. The change
reaches the driver behaviour and every later reader of ADR 0160, who would otherwise take the
original Decision as still in force.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR edits the accepted ADR 0160 in place. Its new `## Amendments` section replaces the Decision item 1 behaviour for a `lastCheck` that is not a timestamp, which changes an accepted decision without a new ADR.

## Fix Focus Areas
- docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[287-303]

## Recommended Fix
Remove the amendment from ADR 0160 so its original decision and status stay unchanged. Add a new ADR that supersedes or refines ADR 0160 for the unparseable-checkpoint case. Its header should state `Supersedes: ADR-0160`, and ADR 0160 should gain only a one-line `Superseded by` or cross-reference note. Keep the implementation unchanged.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

3. Example's queue only covers one workflow file ✓ Resolved Bug Reliability

Resolving commit: 5d27b04

Resolution reason
The example comment and Jira guide now state that the concurrency group serializes only the one
workflow file and that no second workflow may poll the same target repository, which is the
documented mitigation the finding requested.
Description
The new concurrency.group: ${{ github.workflow }}-poll in the custom poller example is keyed by
workflow name, not by target repository, while its comment and the Jira guide say cycles must not
overlap "for one repository". A repo that runs this example next to the managed poll workflow (or
two caller files with the same --target-repo) gets two separate groups, so their cycles overlap
and, with the lock gone, dispatch the same Jira requests twice.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #9852
  🌐 PR #9758
  🌐 PR #9899
✅ Compliance rules (platform): 39 rules
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/agents (sha: 33b4df6f) — View relationship
  Explored: repo: fullsend-ai/react-shopping-cart (sha: 6f3d45d1) — View relationship
  Explored: repo: fullsend-ai/.fullsend (sha: 85ad2d8a) — View relationship
✅ Context preparation
  Commit messages: summarized; full text retained for this review
  Past issues: summarized; full text retained for this review
Review mode: Auto: ⚖️ Balanced: Behavioral poller changes affect locking, permissions, checkpoints, and concurrency.

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit f821b61

Results up to commit e0d3663 🧠 Deep


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Informational
1. Example's queue only covers one workflow file ✓ Resolved Bug Reliability

Resolving commit: 5d27b04

Resolution reason
The example comment and Jira guide now state that the concurrency group serializes only the one
workflow file and that no second workflow may poll the same target repository, which is the
documented mitigation the finding requested.
Description
The new concurrency.group: ${{ github.workflow }}-poll in the custom poller example is keyed by
workflow name, not by target repository, while its comment and the Jira guide say cycles must not
overlap "for one repository". A repo that runs this example next to the managed poll workflow (or
two caller files with the same --target-repo) gets two separate groups, so their cycles overlap
and, with the lock gone, dispatch the same Jira requests twice.

Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://399496d6-site.fullsend-ai.workers.dev

Commit: f821b6184d5492324ac600bdcab73d12154cbf9f

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve with advisories. My current read: this implements ADR 0085 Decision item 1 cleanly. The breaking change is marked with ! and a BREAKING CHANGE trailer, the guide documents the property contract, and the PR body names the writeCheck trade-off. The council consolidated 14 findings, 5 medium and 9 low; none read as blocking to me. Details inline; the medium items are mostly test-depth and example-doc scoping questions.

Verification (this PR is stacked on feat/jirapoll-skip-idle, so lint.yml's pull_request jobs do not run until the retarget to main):

  • go test -race -count=1 ./internal/jirapoll/ ./pkg/behaviourtest/drivers/jiramock/: pass
  • go test -race -count=1 -run 'Jira|jira' ./internal/cli/ ./pkg/behaviourtest/... ./internal/poll/ ./internal/config/ ./internal/scaffold/: pass
  • SKIP=check-gateway-doc-configs,semgrep make lint-all: pass
  • CI on head: behaviour-github-emulator (shards a through p plus playback), dispatch/Route, dispatch/Harness dispatch, build, DCO: all pass; dispatch-gated jobs skipped pending merge order

Medium advisories (inline with details):

  1. Example concurrency group keys on the workflow name, not the target repository (docs/guides/user/custom-poller-example.md:38); with the lock gone, two workflow files polling one repository can run concurrently and dispatch duplicates. This matches the qodo-code-review observation on the same line.
  2. TestRunWriteAccessCheck "one issue denied" never asserts the denied issue's lastCheck stays unset (internal/jirapoll/poller_test.go:1529); the retry-not-drop contract is unpinned.
  3. TestRunIgnoresLegacyLock asserts writeCheck presence only (internal/jirapoll/poller_test.go:1487); the RFC3339 value and write count go unchecked.
  4. The Run contract moves the no-overlap invariant to the caller (internal/jirapoll/poller.go:93), and no test pins the scaffolded caller's concurrency block.

Low advisories (inline with details): writeCheck properties accumulate with no reaper (internal/jirapoll/lock.go:78); the guide does not state the leftover is intentional (docs/guides/user/jira-integration.md:1440); stale lock terminology in test names and the mock counter comment (internal/jirapoll/poller_idle_test.go, poller_test.go:67); internal/jirapoll patch coverage is unmeasured until the retarget, local race runs pass.

Non-inline note: the curator flagged a blog opportunity, the ADR 0085 before-and-after dispatch-rate story, once the remaining epic items land (AISDLC-877 through 882).

Provenance: review council, 7 agents (adversary, architect, curator, fullsend, gaze-testing, guard, testing), all runs successful, 14 findings consolidated, correlation 6f27d589-22da-4341-8532-7f41a4e36e99. Parent issue #9751, criterion 2 of 4.

This review was generated by /uf.review-pr (AI-assisted).

Comment thread internal/jirapoll/poller_test.go Resolved
Comment thread internal/jirapoll/poller_test.go Resolved
Comment thread internal/jirapoll/poller.go Resolved
Comment thread internal/jirapoll/lock.go Resolved
Comment thread docs/guides/user/jira-integration.md Resolved
Comment thread internal/jirapoll/poller_idle_test.go Resolved
Comment thread internal/jirapoll/lock.go Resolved
Review follow-up for the unparseable lastCheck fix.

- TestRunGarbageLastCheckTreatedAsUnset runs a full cycle for each way
  a stored value can fail: a string that is not a time, JSON that is
  not a string, and bytes that are not JSON. The first only reaches the
  time.Parse branch; the other two reach the json.Unmarshal branch.
- It asserts the saved lastCheck equals the issue's updated value
  instead of only being set.
- TestRunAllSelectedIssuesFailedFailsCycle restores coverage of Run's
  all-failed guard, which the replaced test was the only one to reach.

Signed-off-by: guy oron <goron@redhat.com>
Review follow-up for the lock removal.

- A denied issue keeps its lastCheck unset, so its request is retried;
  the served issue's lastCheck is committed.
- The write-check property holds an RFC 3339 time, and a served issue
  costs two property writes: the check and the lastCheck.
- TestRenderJiraPollCaller asserts the managed poll job's concurrency
  group and cancel-in-progress: false. With no per-issue lock, that
  group is what keeps two cycles from overlapping.
- The two filter tests are renamed from FilterLocked to FilterActive,
  and the mock's counter comment no longer refers to a lock.

Signed-off-by: guy oron <goron@redhat.com>
…heck

Review follow-up for the lock removal.

- Restore docs/architecture.md. main already describes the lock
  removal there (ADR 0085), and the edit here conflicted with it.
- The Jira guide says the write-check property stays on the issue and
  why it is not deleted, and that the poll job's concurrency group
  covers one workflow file, so a repository must not be polled from a
  second workflow. The custom poller example says the same.
- Three code comments no longer mention a Jira lock.

Signed-off-by: guy oron <goron@redhat.com>
@guyoron1

Copy link
Copy Markdown
Contributor Author

@jflowers follow-up for your comments is in 71112a5 (tests) and 5d27b04 (docs):

  • Denied issue: the test now checks that its lastCheck stays unset and that the served issue's is committed.
  • Write check: the test checks that the property holds an RFC 3339 time and that a served issue costs two property writes, the check and lastCheck.
  • TestRenderJiraPollCaller asserts the poll job's concurrency group and cancel-in-progress: false.
  • The two filter tests are renamed to FilterActive, and the mock's counter comment no longer mentions a lock.
  • The leftover writeCheck property is deliberate: it is overwritten on each look, and deleting it would cost another call per issue every cycle. The guide says so now.
  • Coverage: 21 of 21 changed production lines are covered in a local profile.

Not changed: the concurrency group key. The example and the guide now say the group covers one workflow file, so a repository must not be polled from a second workflow. The managed template uses the same key, so I left the key itself for a separate decision.

One change you did not ask for: I dropped my docs/architecture.md edit. It conflicted with main, which already describes the lock removal there (ADR 0085).

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review since e0d3663 (prior review: #9853 (review)). Light check: 9 files, 60 lines.

All 8 advisory inline findings from the prior round read as resolved at 5d27b04:

  • docs/guides/user/custom-poller-example.md (line 36) and jira-integration.md (line 993): the concurrency group's single-workflow-file scope is now stated in both places, with the warning not to poll the same repository from a second workflow file.
  • internal/jirapoll/poller_test.go TestRunWriteAccessCheck (lines 1551 to 1556): the denied issue's lastCheck pins to zero, so its request retries; the served issue's lastCheck pins as committed.
  • internal/jirapoll/poller_test.go TestRunIgnoresLegacyLock (lines 1485 to 1494): the write-check property unmarshals and parses as RFC 3339, and propertySetCalls pins at exactly two writes, one write check plus one lastCheck.
  • internal/scaffold/jira_poll_test.go TestRenderJiraPollCaller (lines 48 to 53): the managed caller's concurrency group and cancel-in-progress:false are pinned.
  • internal/jirapoll/poller_idle_test.go: the filter tests are renamed to FilterActive, and the mock counter comment matches the new behavior.
  • docs/guides/user/jira-integration.md (line 1440): the guide now states the writeCheck property stays on the issue, overwritten each look, and why a delete was declined.

One advisory outside this diff, worth a look before the stack lands:

TestApplyCIServerTLSCA_TrustsPrivateCAAndRejectsUntrusted in internal/forge/gitlab/ca_test.go fails deterministically on this head and on the base 0ee5575d (4 of 4 runs; "x509: certificate signed by unknown authority"), and passes on current main (1249bf4ea). This PR's diff contains no forge/gitlab files, so the failure arrives with the stacked branch; would #9758, or something beneath it, be the place to check whether the private-CA append still preserves pre-existing pool CAs?

Local verification: go test ./internal/jirapoll/ ./internal/cli/ and SKIP=check-gateway-doc-configs,semgrep pre-commit run --all-files pass on this head. Full go test ./... fails only in packages this PR does not touch: two scaffold kill-switch tests fail identically on main (host python3 here lacks PyYAML; CI installs it), plus the TLS test above. make check reports ruff errors only in the experiments submodule, which this PR does not modify.

This review was generated by /uf.review-pr (AI-assisted).

…remove-lock

Signed-off-by: guy oron <goron@redhat.com>

# Conflicts:
#	docs/guides/user/jira-integration.md
…seable-lastcheck

Signed-off-by: guy oron <goron@redhat.com>
Signed-off-by: guy oron <goron@redhat.com>

# Conflicts:
#	internal/jirapoll/poller.go
#	internal/jirapoll/poller_test.go
…in merge

The project-set refactor on main describes a processed issue as read
under the lock and its lock as kept single. The lock is gone on this
branch, so the test comment names the write-check property and the
uniqueIssues comment no longer lists a lock.

Signed-off-by: guy oron <goron@redhat.com>

@dhshah13 dhshah13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated on a local merge of main (a5d0fb6), #9852 and 9c87e7e: build, vet, go test -race for jirapoll and jiramock plus the Jira and poll tests in cli, behaviourtest, poll, config and scaffold, and golangci-lint on the new lines all pass. Dropping the write check, moving it after the reads, skipping a denied issue silently, honouring a live legacy lock, or removing the caller's concurrency group each fails a test. Independent review found no MEDIUM+ in the code.

Meets ADR 0085 item 1. Both managed schedulers serialize the poll (the caller's concurrency group and GitLab's fullsend-poll-$FULLSEND_POLL_MODE resource group), and checkpoints commit inside the poll job, so they cover what the lock did. Jira Cloud leaves updated alone on property writes (checked live for #9758), so the write check doesn't make an issue active again.

Non-blocking:

  • TestRunIgnoresLegacyLock doesn't check that the lock goes unread: a filter that reads it and skips the issue on a read error passes the package. This catches it:
    mc.getPropertyHook = func(issueKey, propKey string) {
    	if propKey == legacyLockKey {
    		t.Errorf("read the legacy lock of %s", issueKey)
    	}
    }
    Nothing calls DeleteEntityProperty now, so dropping it from JiraClient makes a delete fail to compile.
  • No test pins the GitLab poll job's resource_group (fullsend-poll.yml:15), which is now the only thing keeping GitLab cycles apart.
  • docs/architecture.md:563-567 still describes the locks and calls their removal a target state (only #9918 fixes it), and docs/normative/normalized-entity/v1/README.md:343 still names the operational lock.
  • The lock.go rename the review bot asks for can wait until the stack lands, since every later PR edits that file.

The ADR 0160 and bundling threads come from #9852's hunk and leave this diff once #9852 merges. As on #9852, CI against main starts with the next push.

…ble-lastcheck

Signed-off-by: guy oron <goron@redhat.com>
…remove-lock

Signed-off-by: guy oron <goron@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:45 PM UTC · Completed 11:54 PM UTC

Commit: 1c73a81 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.75

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

While the PR introduces a breaking lock removal across 15 files in a high-churn component without a feature flag, the established author, absence of protected or CI path changes, solid test coverage, and clean issue alignment keep overall risk moderate.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [stale-doc] docs/normative/normalized-entity/v1/README.md:343 — The Jira property-provenance paragraph still says "Fullsend's operational lock, checkpoint, and comment-marker properties stay in host-side coordination state". This PR removes the per-issue lock property and adds the writeCheck property, so the sentence is now stale. The file is outside this PR's diff.
    Remediation: Reword the sentence to drop the operational lock and name the write-check and checkpoint properties instead.
  • [code-organization] internal/jirapoll/lock.go:1 — The file no longer has any lock types or functions. It holds only property-key helpers, checkWriteAccess and the lastCheck helpers, so the name is misleading.
    Remediation: Rename it (for example properties.go) or merge the helpers into poller.go.

Earlier findings

  • internal/jirapoll/poller.go (PR-level), backward-incompatible — resolved: the Jira guide now documents that overlapping cycles dispatch twice (jira-integration.md), that the old .lock property is no longer read, written or removed, and adds a troubleshooting row; custom-poller-example.md adds a concurrency group and comment.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Every unparseable row of the filter's decision table had updated one
hour ago, inside the backfill window, where "treated as unset" and
"floored to the window start" give the same answer. The new row has
updated three days ago: unset keeps the issue active, while a floor
would drop it and leave the bad value stored.

Signed-off-by: guy oron <goron@redhat.com>
…remove-lock

Signed-off-by: guy oron <goron@redhat.com>
With the lock gone the driver deletes no entity property, so
DeleteEntityProperty leaves the JiraClient interface and the test mock.
A delete now fails to compile, which replaces the mock's delete counter.

TestRunIgnoresLegacyLock also fails if the legacy lock is read: until
now a filter that read it and skipped the issue on a read error passed.

Signed-off-by: guy oron <goron@redhat.com>
The jira-poll driver keeps no per-issue lock, so on GitLab the poll
job's resource group is what keeps two cycles apart. Nothing failed if
the template lost it.

Signed-off-by: guy oron <goron@redhat.com>
docs/architecture.md called the lock's removal a target state, and the
normalized-entity spec listed an operational lock among the properties
Fullsend keeps on an issue. The driver now writes a write-check
property instead.

Signed-off-by: guy oron <goron@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:23 PM UTC · Completed 2:31 PM UTC

Commit: f821b61 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.59

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

While the PR introduces a breaking lock removal across 18 files in a high-churn component without a feature flag, the established author, absence of protected or CI path changes, solid test coverage, and clean issue alignment keep overall risk moderate.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Review

Findings

Low

  • [code-organization] internal/jirapoll/lock.go:1 — The file no longer holds any locking logic after the per-issue lock removal; it now contains property-key helpers, checkWriteAccess and the lastCheck read/clamp/advance logic, so the lock.go filename is misleading.
    Remediation: Optionally rename it to reflect its contents (for example properties.go or checkpoint.go).

Earlier findings

  • docs/normative/normalized-entity/v1/README.md:343, stale-doc, resolved — the sentence now reads "operational write-check, checkpoint, and comment-marker properties" instead of naming the lock.

@fullsend-ai-review
fullsend-ai-review Bot dismissed stale reviews from themself December 3, 2026 14:30

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • internal/jirapoll/lock.go (file-level): Line 1 ·
    [low] code-organization

The file no longer holds any locking logic after the per-issue lock removal; it now contains property-key helpers, checkWriteAccess and the lastCheck read/clamp/advance logic, so the lock.go filename is misleading.

Suggested fix: Optionally rename it to reflect its contents (for example properties.go or checkpoint.go).

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Dec 3, 2026
Merged via the queue into fullsend-ai:main with commit 9c91c62 Dec 3, 2026
58 of 59 checks passed

This branch was successfully deployed

1 active deployment
site-preview — f821b618 Deployed Dec 3, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants