Skip to content

fix(jirapoll): treat an unparseable lastCheck as unset - #9852

Merged
7 commits merged into
fullsend-ai:mainfrom
guyoron1:fix/jirapoll-unparseable-lastcheck
Dec 3, 2026
Merged

7 commits merged into
fullsend-ai:mainfrom
guyoron1:fix/jirapoll-unparseable-lastcheck

Conversation

@guyoron1

@guyoron1 guyoron1 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A lastCheck entity property that is not a timestamp is now treated as unset, as a future value already is, instead of failing the issue on every pick. The issue gets one first-poll look bounded by the backfill window, which saves a valid lastCheck, so a garbage value no longer turns every quiet cycle red.

#9758, which this was stacked on, has merged, so the base is now main. Jira: AISDLC-875.

Related Issue

Fixes #9766

Changes

  • internal/jirapoll/lock.go: loadLastCheck returns a new clampInvalid (value unset, stored value not kept) on a JSON or parse error instead of an error; readLastCheck logs WARNING: lastCheck for <KEY> is not a timestamp; treating as unset without the stored value. A failed read (transport error) is still an error.
  • internal/jirapoll/poller.go: the activity filter's one line per cycle also names these candidates (lastCheck not a timestamp, treated as unset: ...). They stay active, so an editor still cannot hide an issue by writing garbage.
  • internal/jirapoll/poller_idle_test.go: TestRunGarbageLastCheckAloneFailsCycle asserted the old failure; it becomes TestRunGarbageLastCheckTreatedAsUnset, which runs for a string that is not a time, JSON that is not a string, and bytes that are not JSON: cycle 1 succeeds and saves the issue's updated value as lastCheck over the garbage, both log lines appear without the stored value, and cycle 2 skips the issue. TestRunAllSelectedIssuesFailedFailsCycle keeps Run's all-failed guard covered. The filter decision table (not JSON, JSON but not a time, JSON number: all active) is unchanged and passes.
  • docs/ADRs/0160-...md: an Amendments entry replacing Decision item 1's "the existing per-issue error path reports it as today", as Jira poller: an unparseable lastCheck fails every quiet poll cycle #9766 asks. ADR 0160 is Accepted and already on main, so this is an edit to an accepted ADR: it is an appended amendment, as in ADRs 0038 and 0070, and it does not touch the Status lines ADR 0085 edits on main.
  • docs/guides/user/jira-integration.md: the security note and the active-candidate rule cover a lastCheck that is not a timestamp.
  • Review follow-up (3 December): TestFilterLockedActivityDecision gains a row with a stored value that is not a timestamp and updated three days old. It fails if such a value is floored to the window start instead of treated as unset. The earlier rows all had updated inside the window, where the two give the same answer.

Replay stays bounded by one backfill window, the same as deleting or forward-dating the property today.

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/steps/ ./internal/poll/ ./internal/config/ ./internal/scaffold/

All pass. The new test failed on feat/jirapoll-skip-idle (#9758, since merged) without the fix (cycle 1: all 1 selected issues failed to process).

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>
@guyoron1
guyoron1 requested a review from a team as a code owner November 25, 2026 00:45
@qodo-code-review

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

Copy link
Copy Markdown

PR Summary by Qodo

fix(jirapoll): treat an unparseable lastCheck as unset

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• A non-timestamp lastCheck is now treated as unset instead of failing the issue every cycle.
• The issue gets one first-poll look bounded by the backfill window, which saves a valid
 lastCheck.
• Warnings omit the stored value; the filter still keeps such issues active, and transport read
 errors still fail.
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.
  • Malformed checkpoint parsing, activity filtering, bounded discovery, event processing, dispatch preparation, and checkpoint advancement form one Jira polling outcome.
  • These are implementation hops in the same bounded integration, not independent user or system capabilities.
Sources

internal/jirapoll/poller.go[553-557]

	switch lc.clamp {
	case clampFuture:
		clamped.future = append(clamped.future, issue.Key)
	case clampInvalid:
		clamped.invalid = append(clamped.invalid, issue.Key)
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Interacting branches

  • Before: malformed JSON or non-timestamp strings returned errors, causing selected issues to fail and preventing checkpoint advancement.
  • After: both forms follow the existing unset-checkpoint path and receive bounded first-poll handling.
  • New correctness conditions: activity filtering and processing must agree on malformed-state treatment, replay must remain bounded, attacker-writable values must not be logged, and checkpoint advancement must retain its existing processing and dispatch-persistence conditions.
  • The change reuses established checkpoint and dispatch infrastructure and introduces no new concurrency protocol.
Sources

internal/jirapoll/poller.go[553-557]

	switch lc.clamp {
	case clampFuture:
		clamped.future = append(clamped.future, issue.Key)
	case clampInvalid:
		clamped.invalid = append(clamped.invalid, issue.Key)
Potential damage 🟡 Medium 🩹 Recoverable

  • If this changed recovery behavior is faulty, malformed checkpoints can cause bounded replay and duplicate downstream dispatch work.
  • The one-window bound and later checkpoint replacement limit recurrence, but already persisted dispatches are not undone by reverting code.
  • A successful polling cycle must complete event processing and durable dispatch persistence before checkpoint advancement.
  • There is no automatic compensation for duplicate downstream work; checkpoint-write failures can cause later re-detection.
Assessed commit 20982f4
Diagram

graph TD
  A["Jira lastCheck property"] --> B{"Read and parse lastCheck"}
  B -->|"transport error"| C["Fail issue, cycle error"]
  B -->|"not a timestamp"| D["clampInvalid: treat as unset"] --> E["Activity filter keeps issue active"] --> F["One first-poll look saves valid lastCheck"]
Loading
High-Level Assessment

Treating an unparseable lastCheck as unset matches how the driver already handles future-dated values, and it reuses the existing first-poll path. Considered and dismissed: keeping the error (the reported bug: a quiet cycle fails forever); saving a fresh checkpoint without processing (would skip the one look that can surface missed comments); and failing the whole poll on any bad property (lets one editor disrupt all issues). The PR's approach is the simplest that keeps the issue active and bounds replay to one backfill window.

Files changed (5) +103 / -20

Bug fix (2) +23 / -8
lock.goClamp unparseable lastCheck to unset instead of returning an error +14/-5

Clamp unparseable lastCheck to unset instead of returning an error

• loadLastCheck returns a new clampInvalid value on JSON or time-parse errors instead of an error, so the issue is processed as unset. readLastCheck logs a WARNING that omits the stored value. Transport read failures still return an error.

internal/jirapoll/lock.go

poller.goName invalid-lastCheck candidates in the per-cycle activity log +9/-3

Name invalid-lastCheck candidates in the per-cycle activity log

• hasNewActivity routes clampInvalid candidates into a new clampReport.invalid list. The cycle log adds a line naming them, so they stay visible while remaining active.

internal/jirapoll/poller.go

Tests (1) +61 / -10
poller_idle_test.goReplace garbage-lastCheck failure test with treated-as-unset cases +61/-10

Replace garbage-lastCheck failure test with treated-as-unset cases

• TestRunGarbageLastCheckTreatedAsUnset covers a non-time string, non-string JSON, and non-JSON bytes, checking the save, log lines, and idle second cycle. TestRunAllSelectedIssuesFailedFailsCycle keeps the all-failed guard covered using a property read error.

internal/jirapoll/poller_idle_test.go

Documentation (2) +19 / -2
0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.mdAppend amendment to ADR 0160 for non-timestamp lastCheck +17/-0

Append amendment to ADR 0160 for non-timestamp lastCheck

• Adds an Amendments section that supersedes Decision item 1's claim that the per-issue error path reports a bad checkpoint. It documents the unset treatment, the warning, and the bounded replay.

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

jira-integration.mdDocument non-timestamp lastCheck in poll coordination and security note +2/-2

Document non-timestamp lastCheck in poll coordination and security note

• The active-candidate rule and security note now list a non-timestamp lastCheck as no usable value. They also give the warning text and the one-look behaviour.

docs/guides/user/jira-integration.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 (1)

Grey Divider


Remediation recommended

1. Accepted decision is changed without a successor record 📘 Rule violation ⌂ Architecture
Description
The new Amendments section appended to the accepted ADR states that the existing per-issue error
path is replaced for unparseable lastCheck values, so the treatment in Decision item 1 is changed
in place. The original Decision item 1 text remains in the file, so a later reader must follow the
appended amendment to learn the current behaviour. Whether this rule applies depends on the ADR
already being on main, which the diff does not show.
Code

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

+Decision item 1 sends a checkpoint that cannot be parsed to processing,
+where "the existing per-issue error path reports it as today". That path
+fails the issue on every pick and never saves a new checkpoint, so the
+issue is never processed again, and when it is the only active candidate
Relevance

●●● Strong

Team's accepted precedents consistently ask that substantive edits to accepted ADRs be reverted and
moved to annotations or superseding ADRs.

PR-#5244
PR-#7812
PR-#6375

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The amendment changes the decision of an accepted ADR without a superseding ADR. Rule 1062058
forbids this, and rule 1062057 limits edits to Context, Decision and Consequences of accepted ADRs
to annotations. The PR description says the amendment is intentional and was requested in #9766.

Rule 1062058: Supersede accepted ADRs with new ADRs instead of modifying history
docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[4-4]
docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[281-288]

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 changes the unparseable-`lastCheck` decision of an ADR whose status is `Accepted`, by appending an Amendments section that overrides Decision item 1. Rule 1062058 requires a new ADR that supersedes the old one instead of changing an accepted decision.

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

## Recommended Fix
Create a new ADR (next free number) that records the unparseable-`lastCheck`-as-unset decision and states `Supersedes: ADR 0160` for that item. Mark ADR 0160 with the status `Superseded` and a `Superseded by` line pointing to the new ADR, as rule 1062061 allows, and keep its original Decision text unchanged. Remove the Amendments section, and update docs/architecture.md if the new ADR is accepted. Confirm the PR description links the new ADR.

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

Dismiss ↗ | View ↗



Informational

2. Amendment claims have no pinned commit 📜 Skill insight ≡ Correctness
Description
The new ADR 0160 amendment states present-tense driver behaviour ("The driver now treats a stored
value that is not a timestamp as unset"), but the PR description names only the files and functions
(loadLastCheck, readLastCheck, poller.go) and gives no commit SHA for them. A reviewer or
later ADR reader therefore cannot check those claims against a fixed code revision, and the gap sits
in the PR description rather than the ADR text.
Code

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

+### 2026-11-25: A checkpoint that is not a timestamp is treated as unset (#9766)
+
+Decision item 1 sends a checkpoint that cannot be parsed to processing,
+where "the existing per-issue error path reports it as today". That path
Relevance

● Weak

Author dismissed a near-identical ADR commit-pin request (#9477); similar pin requests also rejected
in #9186 and #9084.

PR-#9477
PR-#9186
PR-#9084

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The amendment makes current-behaviour claims about the driver, and the PR description cites
implementing functions without any commit SHA, so the rule's commit-pinned evidence requirement is
not met.

docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[283-292]
Skill: writing-adrs

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 description does not give commit-pinned implementation evidence for the current-behaviour claims in the new ADR 0160 amendment. It names files and functions (`internal/jirapoll/lock.go` `loadLastCheck`/`readLastCheck`, `internal/jirapoll/poller.go`) but no commit SHA, so the claims cannot be checked against a fixed code revision.

## Fix Focus Areas
- docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[283-292]
- internal/jirapoll/lock.go[235-255]

## Recommended Fix
In the PR description, add a line for each behaviour claim in the amendment that names the implementing function and the commit SHA where it was verified, for example: "Evidence for the ADR amendment: `loadLastCheck` in `internal/jirapoll/lock.go` at commit <sha>." Use the head commit of this branch, not `main` or the branch name.

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #9758
✅ Compliance rules (platform): 39 rules
✅ Skills: writing-user-docs
✅ Cross-repo context — repo relationships
Review mode: Auto: 🚀 Fast: Localized poller reporting and test updates with no high-risk surface.

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 20982f4

Results up to commit 527843f ⚖️ Balanced


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


Remediation recommended
1. Accepted decision is changed without a successor record 📘 Rule violation ⌂ Architecture
Description
The new Amendments section appended to the accepted ADR states that the existing per-issue error
path is replaced for unparseable lastCheck values, so the treatment in Decision item 1 is changed
in place. The original Decision item 1 text remains in the file, so a later reader must follow the
appended amendment to learn the current behaviour. Whether this rule applies depends on the ADR
already being on main, which the diff does not show.
Code

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

+Decision item 1 sends a checkpoint that cannot be parsed to processing,
+where "the existing per-issue error path reports it as today". That path
+fails the issue on every pick and never saves a new checkpoint, so the
+issue is never processed again, and when it is the only active candidate
Relevance

●●● Strong

Team's accepted precedents consistently ask that substantive edits to accepted ADRs be reverted and
moved to annotations or superseding ADRs.

PR-#5244
PR-#7812
PR-#6375

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The amendment changes the decision of an accepted ADR without a superseding ADR. Rule 1062058
forbids this, and rule 1062057 limits edits to Context, Decision and Consequences of accepted ADRs
to annotations. The PR description says the amendment is intentional and was requested in #9766.

Rule 1062058: Supersede accepted ADRs with new ADRs instead of modifying history
docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[4-4]
docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[281-288]

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 changes the unparseable-`lastCheck` decision of an ADR whose status is `Accepted`, by appending an Amendments section that overrides Decision item 1. Rule 1062058 requires a new ADR that supersedes the old one instead of changing an accepted decision.

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

## Recommended Fix
Create a new ADR (next free number) that records the unparseable-`lastCheck`-as-unset decision and states `Supersedes: ADR 0160` for that item. Mark ADR 0160 with the status `Superseded` and a `Superseded by` line pointing to the new ADR, as rule 1062061 allows, and keep its original Decision text unchanged. Remove the Amendments section, and update docs/architecture.md if the new ADR is accepted. Confirm the PR description links the new ADR.

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

Dismiss ↗ | View ↗



Informational
2. Amendment claims have no pinned commit 📜 Skill insight ≡ Correctness
Description
The new ADR 0160 amendment states present-tense driver behaviour ("The driver now treats a stored
value that is not a timestamp as unset"), but the PR description names only the files and functions
(loadLastCheck, readLastCheck, poller.go) and gives no commit SHA for them. A reviewer or
later ADR reader therefore cannot check those claims against a fixed code revision, and the gap sits
in the PR description rather than the ADR text.
Code

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

+### 2026-11-25: A checkpoint that is not a timestamp is treated as unset (#9766)
+
+Decision item 1 sends a checkpoint that cannot be parsed to processing,
+where "the existing per-issue error path reports it as today". That path
Relevance

● Weak

Author dismissed a near-identical ADR commit-pin request (#9477); similar pin requests also rejected
in #9186 and #9084.

PR-#9477
PR-#9186
PR-#9084

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The amendment makes current-behaviour claims about the driver, and the PR description cites
implementing functions without any commit SHA, so the rule's commit-pinned evidence requirement is
not met.

docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[283-292]
Skill: writing-adrs

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 description does not give commit-pinned implementation evidence for the current-behaviour claims in the new ADR 0160 amendment. It names files and functions (`internal/jirapoll/lock.go` `loadLastCheck`/`readLastCheck`, `internal/jirapoll/poller.go`) but no commit SHA, so the claims cannot be checked against a fixed code revision.

## Fix Focus Areas
- docs/ADRs/0160-spend-jira-poll-slots-only-on-candidates-with-new-activity.md[283-292]
- internal/jirapoll/lock.go[235-255]

## Recommended Fix
In the PR description, add a line for each behaviour claim in the amendment that names the implementing function and the commit SHA where it was verified, for example: "Evidence for the ADR amendment: `loadLastCheck` in `internal/jirapoll/lock.go` at commit <sha>." Use the head commit of this branch, not `main` or the branch name.

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

Dismiss ↗ | View ↗


Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://64ff0410-site.fullsend-ai.workers.dev

Commit: 20982f4eeb9227eb2e6f77e6642ec4ffb0040b22

@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.

Council review: fix(jirapoll): treat an unparseable lastCheck as unset

7/7 dispatched reviewers completed (adversary, architect, curator, fullsend, gaze-testing, guard, testing); the verdict reads APPROVE WITH ADVISORIES, with no CRITICAL or HIGH findings. Two MEDIUM test-coverage advisories and five LOW notes follow inline.

The core change holds up well: an unparseable lastCheck now follows the future-value path (unset, one backfill-window-bounded look, a valid checkpoint saved over the garbage), the stored value never reaches the logs, transport errors stay errors, and the issue stays active so an editor cannot hide it. lint.yml did not run at CI on this head (it triggers only on PRs to main); local runs on the head cover the gap: go build, affected-package tests with -race, and pre-commit on the changed files all pass.

Advisories worth a look before or soon after merge:

  • the #9766 regression test drives only the time.Parse failure flavor; the json.Unmarshal branch (a JSON number or object as lastCheck) keeps no end-to-end pin, so a partial revert of that one branch passes the whole suite (MEDIUM)
  • deleting TestRunGarbageLastCheckAloneFailsCycle leaves Run's all-selected-issues-failed guard (poller.go:190) with no direct coverage; the package's other two Run guards each keep a dedicated test (MEDIUM)
  • the ADR 0160 Amendments section lands on a not-yet-merged ADR; docs/contributing/adrs.md prefers direct content edits while an ADR is in flight (LOW, two reviewers)
  • the patch coverage gate (80/75) stays unverified on this head until the retarget to main (LOW)
  • the saved-checkpoint assertion checks non-zero rather than the exact updated value (LOW)

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

Comment thread internal/jirapoll/poller_idle_test.go Resolved
Comment thread internal/jirapoll/poller_idle_test.go Resolved
Comment thread internal/jirapoll/poller_idle_test.go 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>

@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 (light re-review)

Light check since 527843f, the commit carrying the prior review. The delta touches only tests: 1 file, 92 lines in internal/jirapoll/poller_idle_test.go.

Prior advisories: 4 of 7 resolved, 3 carried

Resolved by the delta:

  • poller_idle_test.go:399 (parse flavor pin covered only time.Parse): the table now covers all three clampInvalid inputs end to end (garbage string, JSON object, non-JSON), so the json.Unmarshal flavor is pinned too.
  • poller_idle_test.go:344 (all-failed guard at poller.go:190 left uncovered): TestRunAllSelectedIssuesFailedFailsCycle drives a 503 property-get and asserts the "all 1 selected issues failed to process" error with 0 dispatches.
  • poller_idle_test.go:344 (clampInvalid variants lacked a cycle-level test): all three cases run through Run now, asserting cycle 1 success, exact storedLastCheckAt(...).Equal(updated), both log lines, and that the log never prints the stored value.
  • poller_idle_test.go:356 (IsZero() non-exact): assertions use exact Equal(updated) at line 368.

Carried (all LOW, tracked in the prior review's open threads):

  • ADR 0160 uses an Amendments section on an ADR that has not merged yet, versus the direct-edit pattern of ADRs 0038 and 0070. The Status-line-conflict rationale is defensible; worth revisiting the placement at retarget?
  • ADR 0160 Decision item 1 keeps its original wording.
  • lock.go:238 patch coverage stays unverified until the retarget to main; the delta adds only test lines, which can only help coverage.

Checks

  • CI: behaviour-github-emulator matrix, build, and DCO pass; other checks skipped as expected.
  • Local: pre-commit pass on the 5 changed files; go build ./... clean; go test -race -count=1 ./internal/jirapoll/ ./pkg/behaviourtest/drivers/jiramock/ ok (1.390s / 1.506s).

Fixes #9766.

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

@guyoron1

Copy link
Copy Markdown
Contributor Author

@jflowers thanks for the review. The test follow-up is in c999cae:

  • TestRunGarbageLastCheckTreatedAsUnset now runs a full cycle for three stored values: a string that is not a time, a JSON object, and bytes that are not JSON. The last two reach the json.Unmarshal branch; I checked that reverting only that branch fails them.
  • It asserts the saved lastCheck equals the issue's updated, not only that one was saved.
  • TestRunAllSelectedIssuesFailedFailsCycle covers Run's all-failed guard again.
  • Coverage: 9 of 9 changed production lines are covered in a local profile.

On the ADR: 0160 is already on main (Accepted, added 6 Nov in 1b2a002), not only on #9758. So I left Decision item 1 as it is and appended an amendment, as 0038 and 0070 do. It sits at the end of the file, so it reads the same whichever order the stack merges in.

…seable-lastcheck

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

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

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

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

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:39 AM UTC · Completed 9:48 AM UTC

Commit: b3b6024 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Dec 1, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk: focused 123-line bug fix with full acceptance criteria coverage and test additions, balanced by elevated churn and coupling in the touched Jira poller components without feature-flag gating.

@fullsend-ai-review

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

Copy link
Copy Markdown

Looks good to me

@dhshah13
dhshah13 deleted the branch fullsend-ai:feat/jirapoll-skip-idle December 2, 2026 14:43
@dhshah13 dhshah13 closed this Dec 2, 2026
@dhshah13 dhshah13 reopened this Dec 2, 2026
@dhshah13
dhshah13 changed the base branch from feat/jirapoll-skip-idle to main December 2, 2026 14:46
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b3b6024

@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 b3b6024 into main (a5d0fb6): build, vet, go test -race for jirapoll and jiramock plus the Jira tests in cli, steps, poll, config and scaffold, and golangci-lint on the new lines all pass. Reverting either error branch, dropping either log line, or logging the stored value each fails a test. Independent review found no MEDIUM+ in the code.

Matches #9766. The amendment is the right form for an accepted ADR: 0160 has been on main since 1b2a002, and 0038 and 0070 carry the same section.

Non-blocking: no test tells "unset" from "floored to the window start" for a bad value. Flooring it still passes the package, and then an issue last updated more than a day ago stays idle with the bad value stored. One row in TestFilterLockedActivityDecision catches it:

{name: "JSON but not a time, updated 3 days ago", stored: json.RawMessage(`"yesterday"`), updated: now.Add(-72 * time.Hour).Format(jiraTimeLayout), active: true},

CI (lint.yml, with the required semgrep) hasn't run on this PR. The base moved to main without a push, which fires only edited, so the next push starts it.

…ble-lastcheck

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:53 PM UTC

Commit: 2ec3341 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Dec 2, 2026

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One test-coverage finding, inline.

} {
t.Run(tc.name, func(t *testing.T) {
now := time.Now().Truncate(time.Second)
updated := now.Add(-time.Hour)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

MEDIUM: no test tells "treated as unset" apart from "floored to the window start" for an unparseable lastCheck

This test sets updated = now-1h for every case. The filterLocked table (lines 438-439) also puts its unparseable rows at updated = now-1h. Both values fall inside the 24h window.

Suppose an implementation kept clampInvalid and its log lines but set value = now-window, which is the clampFloor behaviour. The issue would still be active, get processed and store updated, so every current assertion would still pass.

The two behaviours differ only when updated is older than the window:

  • Unset: lc.value.IsZero() keeps the issue active, so it is visited and the garbage is overwritten.
  • Floor: the issue is idle, as in the "2020, updated 3 days ago" row (active: false), and the garbage stays.

So no test pins the semantics described in the comment at lock.go:238-243 and in the ADR amendment. The earlier exact-value thread was fixed by the switch to Equal(updated), but that check still passes under a floor clamp.

Suggestion: add a filterLocked decision-table row with an unparseable stored value and updated = now-72h that expects active: true. Or add a Run case with updated = now-72h and a garbage lastCheck that asserts the issue is visited and storedLastCheckAt(...).Equal(updated).

Verified: read code at head (lock.go:238-252, poller.go:547-552, poller_idle_test.go:351-452); grep found no unparseable-value case with updated outside the window at 2ec3341; raised by: DeepSeek

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.

Agreed, it should go in before merge. This row passes on 2ec3341 and fails when the bad value is floored instead of treated as unset:

{name: "JSON but not a time, updated 3 days ago", stored: json.RawMessage(`"yesterday"`), updated: now.Add(-72 * time.Hour).Format(jiraTimeLayout), active: true},

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.

This row covers the time.Parse branch (lock.go:253). Flooring only the json.Unmarshal branch (lock.go:246) still passes the package, because every row that reaches it has updated inside the window. One more row catches it:

{name: "not JSON, updated 3 days ago", stored: json.RawMessage(`not json`), updated: now.Add(-72 * time.Hour).Format(jiraTimeLayout), active: true},

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk: focused 123-line bug fix with full acceptance criteria coverage and test additions, balanced by elevated churn and coupling in the touched Jira poller components without feature-flag gating.

@fullsend-ai-review

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

Copy link
Copy Markdown

Looks good to me


Labels: Go bug fix in the Jira poller (internal/jirapoll) with an ADR amendment and doc update.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review December 2, 2026 23:53

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge go Pull requests that update go code type/bug Confirmed defect in existing behavior labels Dec 2, 2026
@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>
@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:24 PM UTC · Completed 2:29 PM UTC

Commit: 20982f4 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk: focused 124-line bug fix with full acceptance criteria coverage and test additions, balanced by elevated churn and coupling in touched Jira poller components without feature-flag gating.

@fullsend-ai-review

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

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review December 3, 2026 14:28

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
@github-merge-queue github-merge-queue Bot closed this pull request by merging all changes into fullsend-ai:main in 9c91c62 Dec 3, 2026

This branch was successfully deployed

1 active deployment
site-preview — 20982f4e 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

go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge risk/moderate PR risk: moderate type/bug Confirmed defect in existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira poller: an unparseable lastCheck fails every quiet poll cycle

4 participants