Skip to content

Track review round number on jobs - #220

Open
ZYZ666-RGB wants to merge 1 commit into
devarshishimpi:mainfrom
ZYZ666-RGB:fix-212-review-round
Open

ZYZ666-RGB wants to merge 1 commit into
devarshishimpi:mainfrom
ZYZ666-RGB:fix-212-review-round

Conversation

@ZYZ666-RGB

Copy link
Copy Markdown

Description

Adds a review_round column on jobs and computes it atomically in insertJob as one plus the number of prior done or failed jobs on the same (repository_id, pr_number). superseded and cancelled jobs do not increment the round, so aborted runs are ignored. The first job on a pull request gets reviewRound = 1.

Fixes #212

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit Tests
  • Integration Tests

npm run typecheck, npm run lint, and npm test all passed locally (572 tests). New coverage is in test/db/review-round.spec.ts: first job is 1, done/failed increment, superseded/cancelled do not, and different PRs are counted independently.

Checklist:

  • I have starred Codra on GitHub
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have signed the CLA

Count prior done/failed jobs on the same pull request and store
prior_rounds + 1 atomically so aborted superseded or cancelled runs
do not inflate the round. First jobs start at 1.

Closes devarshishimpi#212

Signed-off-by: yuzhou <1991039819@qq.com>

@codra-app-personal codra-app-personal 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.

Codra Review

✅ Nothing to flag. Reviewed 7 files (164 changed lines) and found no issues worth raising.

Reviewed commit: 9bd3f2aa54

ℹ️ About Codra in GitHub

Your team has set up Codra to review pull requests in this repo. Reviews are triggered when you:

  • Open a pull request for review
  • Mark a draft as ready

Every review posts a summary here. A clean pass also gets a 👍 on the pull request itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track Review Round Number on Jobs

1 participant