Repository navigation
Conversation
collectIssueChangelogs only selected issues updated since the previous sync in incremental mode. Changelogs truncated to the newest 40 histories by builds without apache#9377 were therefore never re-collected after upgrading, unless a full sync was run. In incremental mode, also select the issues whose stored changelog has fewer rows than changelog_total. The selection is extracted into BuildChangelogCollectorClauses and covered by an e2e test. Closes apache#9419
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.
Summary
Fixes the second point of #9419: changelogs truncated to the newest 40 histories (by builds that already collected issues through the search API but did not have #9377) are never repaired by incremental syncs after upgrading.
In incremental mode
collectIssueChangelogsonly selected issues withi.updated > since. An issue whose changelog was truncated by an affected build and has not changed since is never selected again, so its oldest histories (often its first status transitions) stay missing unless the user runs a full sync.This PR:
_tool_jira_issue_changelogsthanchangelog_total, so they are re-collected once and repaired. Issues with a complete changelog keep being skipped, so steady-state syncs do not do extra work (_tool_jira_issue_changelogs.issue_idis indexed);BuildChangelogCollectorClauses, so it can be tested;TestChangelogCollectorClauses(e2e,plugins/jira/e2e), with an updated issue, a truncated issue that was not updated, a complete issue that was not updated, an issue below the search API limit, an epic and an issue from another board. It fails onmain(the truncated issue is not selected) and passes with this change.go vet ./plugins/jira/...andgo test ./plugins/jira/...(withE2E_DB_URLon MySQL 8.0) pass locally.Does this close any open issues?
Closes #9419 (the first point there, shipping #9377 in a release, is up to the maintainers).
Screenshots
Not applicable (backend change).
Other Information
The repair relies on
changelog_totalmatching the number of histories the changelog endpoint returns. If, for some issue, Jira reports more histories than it returns (for example, entries hidden by permissions), that issue would be re-collected on every incremental sync. That is the same cost a full sync already pays for every issue, so I kept it simple; happy to add a guard (for example, comparing againstIssueUpdated) if you prefer.