Skip to content
Success

Changes

Summary

  1. fix(tools, prow-jobs): fix test issue reopen problem (#4360) (commit: a69c7bb) (details)
Commit a69c7bb38d7e9727a11426d6b1c92e7f28238333 by noreply
fix(tools, prow-jobs): fix test issue reopen problem (#4360)

This pull request introduces a safeguard to the GitHub issue management
logic for flaky test reporting: closed issues will now only be reopened
if they have been closed for at least 10 days. The changes are
implemented in both the application logic and the documentation, and new
tests are added to ensure correct behavior. There are also some
refactorings and minor improvements for clarity and maintainability.

**Flaky Test Reporter: GitHub Issue Management**

*New Reopen Policy & Logic:*
- Introduced a minimum closed age threshold (10 days) before a closed
issue can be reopened, preventing premature reopenings. The logic is
encapsulated in a new method, and a note is attached to cases where
reopening is skipped.
[[1]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aR32-R37)
[[2]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL270-R323)
[[3]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aR435-R484)
- Added an optional `now` parameter to the `GithubIssueManager` for
testability and improved time handling.
[[1]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aR23)
[[2]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aR199)
[[3]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aR214)

*Testing:*
- Added comprehensive tests for the new reopen policy, verifying that
only issues closed for at least 10 days are reopened and others are left
closed with an explanatory note. (`GithubIssueManager.test.ts`)

*Documentation:*
- Updated documentation to clarify that `--issue-reopen` only allows
reopening issues closed for at least 10 days, both in the permissions
and behavior sections.
[[1]](diffhunk://#diff-e162c65e3a6c93d06a8c86af46500b96320812261d3c0f17d3f47911558a2b72L117-R117)
[[2]](diffhunk://#diff-e162c65e3a6c93d06a8c86af46500b96320812261d3c0f17d3f47911558a2b72L182-R182)

*Job Configuration:*
- Refactored periodic job configs to use a new `PARAM_ISSUE_OPS_OPTIONS`
environment variable for issue operation flags, improving flexibility in
how issue operations are enabled per job.
[[1]](diffhunk://#diff-627e88a7426360b8626ef9a0002f3558221924cb7e816f08afa52255839473d7L56-R56)
[[2]](diffhunk://#diff-627e88a7426360b8626ef9a0002f3558221924cb7e816f08afa52255839473d7R68-R69)
[[3]](diffhunk://#diff-627e88a7426360b8626ef9a0002f3558221924cb7e816f08afa52255839473d7R133-R134)
- Unhid two periodic reporter jobs by commenting out the `hidden: true`
line, making them visible in the job dashboard.
[[1]](diffhunk://#diff-627e88a7426360b8626ef9a0002f3558221924cb7e816f08afa52255839473d7L31-R31)
[[2]](diffhunk://#diff-627e88a7426360b8626ef9a0002f3558221924cb7e816f08afa52255839473d7L122-R121)

*Minor Refactoring:*
- Improved code formatting and type annotations in
`GithubIssueManager.ts` for readability and maintainability.
[[1]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL1-R12)
[[2]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL34-R63)
[[3]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL55-R75)
[[4]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL69-R91)
[[5]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL81-R105)
[[6]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL91-R117)
[[7]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL317-R352)
[[8]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL330-R367)
[[9]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL343-R381)
[[10]](diffhunk://#diff-bbf5b1e359b7ef42a9547f82763bbd291bf9880f90c43763a059ab1300291b5aL383-R422)
(commit: a69c7bb)
The file was modifiedtools/reporters/ci/flaky-tests/core/GithubIssueManager.ts (diff)
The file was modifiedtools/reporters/ci/flaky-tests/docs/README.md (diff)
The file was addedtools/reporters/ci/flaky-tests/core/GithubIssueManager.test.ts
The file was modifiedprow-jobs/pingcap-qe/ci/periodics.yaml (diff)