Skip to content

update mini sysbench to use kubernetes - #3056

Open
jycor wants to merge 2 commits into
mainfrom
james/mini
Open

update mini sysbench to use kubernetes#3056
jycor wants to merge 2 commits into
mainfrom
james/mini

Conversation

@jycor

@jycor jycor commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@jycor

jycor commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

#benchmark

@jycor

jycor commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

#benchmark

@itoqa

itoqa Bot commented Aug 7, 2026

Copy link
Copy Markdown

Ito QA test results
Commit: 598850c: 21 test cases ran, 2 failed ❌, 18 passed ✅, 1 additional finding ⚠️.

Summary

Coverage spans authorization boundaries, benchmark dispatch rules, external result retrieval, pull-request reporting, failure handling, and comment lifecycle behavior. It includes normal flows plus malformed-input, missing-data, access-denial, stale-result, and cross-identity edge cases, with generally healthy behavior aside from important publication-safety gaps.

Not safe to merge yet — this PR introduces a high-severity risk that results can be published to the wrong pull request, along with medium-severity malformed issue handling that can route publication to an invalid target. An unrelated medium-severity concurrency issue remains a flag for later and does not drive the merge decision.

Tests run by Ito

View full run

Result Severity Type Description
High severity Storage The workflow posted a benchmark result from another pull request to issue 42 instead of rejecting the mismatched object and issue.
Medium severity Gate The workflow did not reject malformed issue numbers before starting the report publication path. Missing, empty, and non-numeric values were treated as eligible, then became an invalid issue target.
Authorization Every listed authorized identity was accepted, including the six newly added names. Each check returned success and produced the expected affirmative result.
Authorization The authorization check rejected both the removed user max-hoffman and an unrelated unknown user without granting access.
Authorization Empty, partial, differently cased, and space-padded names were all denied without producing an authorization result.
Authorization The exact authorized actor was accepted, while case changes, added characters, surrounding spaces, and an empty name were denied.
Comment A completed benchmark result creates one pull-request comment with the marker, actor, format, and result text when no matching comment exists.
Comment An existing benchmark comment keeps its marker and is replaced with the new actor, format, and results. No second comment is created.
Comment Unusual benchmark result text is kept as comment content without changing the report marker or its surrounding metadata. Empty, malformed, oversized, mention-like, and comment-like content either remains attributable to the downloaded report or produces a visible publication error.
Comment If the comment service fails after the report is downloaded, the workflow also fails instead of claiming the report was posted. A later retry checks for the marked comment again and creates or updates one report after the service recovers.
Gate An authorized benchmark request with pull request number 42 was dispatched, accepted by the reporting job, and prepared the result comment for pull request 42.
Gate A benchmark dispatch marked as not belonging to a pull request was recorded, but no reporting job ran and no pull-request comment was created or changed.
Gate A benchmark starts only when an approved person includes the benchmark marker in the comment. Comments without the marker or from an unapproved person do not start a dispatch.
Local The benchmark workflow downloaded one external report and posted it to the pull request. It did not run local benchmarks or compare two checkout results.
Local When the selected benchmark report was missing, the workflow stopped during download and did not publish a new or empty report. The existing benchmark comment stayed unchanged.
Local The published report kept the clear MISSING-CASE message, and the existing benchmark comment was updated without creating a duplicate.
Storage Valid access downloaded the selected fresh result, and the publication step read RESULT-FRESH from results.log.
Storage The workflow stopped before publishing a pull-request comment when credentials could not access the benchmark result.
Storage The workflow stopped during result retrieval for missing or wrong bucket and key values, so no pull-request comment was created or updated.
Storage The workflow downloaded the requested fresh result and published RESULT-FRESH. It did not use the nearby stale result.
⚠️ Medium severity Comment Overlapping benchmark reports do not reliably converge to one current comment. Both runs can create a marker comment when neither sees one, and two updates can finish in either order.
Additional Findings Details

These findings are unrelated to the current changes but were observed during testing.

🟡 Overlapping reports can duplicate or overwrite comments
  • Severity: Medium Medium severity
  • Description: Overlapping benchmark reports do not reliably converge to one current comment. Both runs can create a marker comment when neither sees one, and two updates can finish in either order.
  • Impact: Reviewers may see duplicate benchmark comments or an older result after a newer run finishes. The report can be corrected by rerunning the workflow or removing the stale comment.
  • Steps to Reproduce:
    1. Start two benchmark report workflow runs for the same pull request with different result text.
    2. Pause both runs after they list pull-request comments and before either run creates or updates the marker comment.
    3. Allow both runs to continue, then inspect the pull-request conversation and the final marker comment body.
  • Stub / mock content: No stubs, mocks, or bypasses were applied for this test in the recorded run.
  • Code Analysis: The Post results to PR script in .github/workflows/mini-sysbench.yml reads results.log at lines 39-40, lists comments at lines 44-49, and selects the first comment containing the marker at line 52. It then branches at line 54: an existing marker is updated through github.rest.issues.updateComment at lines 56-61, while no marker causes github.rest.issues.createComment at lines 63-69. The list and the subsequent write are separate GitHub API operations with no lock, compare-and-swap condition, idempotency key, retry reconciliation, or second list. If two runs list before either create completes, both receive no matching comment and both create one. If both find the same marker, the last update request to complete wins regardless of which benchmark run is newer. A targeted fix should serialize publication per pull request or re-list and reconcile after create/update, using an explicit run ordering rule so only one current marker comment remains.
Evidence Package

Tip

Reply with @itoqa to send us feedback on this test run.

runs-on: ubuntu-latest

runs-on: ubuntu-22.04
if: ${{ github.event.client_payload.issue_number != -1 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

View replay

Medium severity Malformed issue values reach report publication

What failed: The workflow did not reject malformed issue numbers before starting the report publication path. Missing, empty, and non-numeric values were treated as eligible, then became an invalid issue target.

Impact · Steps · Stub / mock · Analysis · Why this is likely a bug
  • Severity: Medium Medium severity
  • Impact: When the issue number is missing or malformed, the report job can fail or try to publish to an invalid issue instead of stopping safely. Reports for affected runs may not be posted to the intended pull request.
  • Steps to Reproduce:
    1. Create a repository-dispatch payload with issue_number absent, empty, or set to a non-numeric value such as abc.
    2. Run the mini-sysbench workflow with otherwise valid benchmark metadata.
    3. Observe that the job condition allows the job to proceed instead of rejecting the payload.
    4. Observe that the publication script parses the value as NaN and passes it to the GitHub comments API calls.
  • Stub / mock content: The test used a local workflow simulator with mocked S3 retrieval and pull-request comment calls; no GitHub credentials or production endpoints were used.
  • Code Analysis: The changed job condition at .github/workflows/mini-sysbench.yml:14 only excludes the numeric sentinel -1: ${{ github.event.client_payload.issue_number != -1 }}. For undefined, '', and 'abc', this expression is true, so the job continues. In the actions/github-script step, line 37 reads const issue_number = parseInt(ISSUE_NUMBER, 10);; each of those malformed values produces NaN. The value is then supplied as issue_number to github.rest.issues.listComments at lines 45-49 and to github.rest.issues.createComment at lines 64-68. The local executable reproduction confirmed eligible=true and parsed=NaN for the malformed cases, while the numeric string '42' remained eligible and parsed to 42. The smallest practical fix is to validate that the payload is a positive integer before the job proceeds, or to add an explicit early exit in the script before any GitHub API call; the validation should also reject the string sentinel '-1' and other non-numeric values.
  • Why this is likely a bug: The test's expected behavior is to skip or visibly reject malformed values before publication, and the source path contradicts that requirement in an executable way. The gate admits malformed input, parseInt converts it to NaN, and the result is used as the target for GitHub issue API requests. This is a production workflow defect rather than a browser or simulator artifact because the same behavior follows directly from the checked-in expression and JavaScript parsing semantics. A positive numeric string remains supported, so the targeted fix is input validation at the new gate or immediately before the API calls, not a rewrite of the publication logic.
Relevant code

.github/workflows/mini-sysbench.yml:14

if: ${{ github.event.client_payload.issue_number != -1 }}

.github/workflows/mini-sysbench.yml:35-37

const { ACTOR, FORMAT, ISSUE_NUMBER, JOB_TYPE, GITHUB_WORKSPACE } = process.env;
const { owner, repo } = context.repo;
const issue_number = parseInt(ISSUE_NUMBER, 10);

.github/workflows/mini-sysbench.yml:45-49

const { data: comments } = await github.rest.issues.listComments({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo
});

.github/workflows/mini-sysbench.yml:64-68

await github.rest.issues.createComment({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo,
  body: `${commentMarker}\n@${ACTOR} ${FORMAT}\n${resData}`
});
Evidence Package
Copy prompt for an agent
Ito QA identified the following failure during automated PR testing. Please investigate and propose a fix.

**Medium severity — Malformed issue values reach report publication**

**What failed:** The workflow did not reject malformed issue numbers before starting the report publication path. Missing, empty, and non-numeric values were treated as eligible, then became an invalid issue target.

- **Impact:** When the issue number is missing or malformed, the report job can fail or try to publish to an invalid issue instead of stopping safely. Reports for affected runs may not be posted to the intended pull request.
- **Steps to reproduce:**
  1. Create a repository-dispatch payload with `issue_number` absent, empty, or set to a non-numeric value such as `abc`.
  2. Run the `mini-sysbench` workflow with otherwise valid benchmark metadata.
  3. Observe that the job condition allows the job to proceed instead of rejecting the payload.
  4. Observe that the publication script parses the value as `NaN` and passes it to the GitHub comments API calls.
- **Stub / mock content:** The test used a local workflow simulator with mocked S3 retrieval and pull-request comment calls; no GitHub credentials or production endpoints were used.
- **Code analysis:** The changed job condition at `.github/workflows/mini-sysbench.yml:14` only excludes the numeric sentinel `-1`: `${{ github.event.client_payload.issue_number != -1 }}`. For `undefined`, `''`, and `'abc'`, this expression is true, so the job continues. In the `actions/github-script` step, line 37 reads `const issue_number = parseInt(ISSUE_NUMBER, 10);`; each of those malformed values produces `NaN`. The value is then supplied as `issue_number` to `github.rest.issues.listComments` at lines 45-49 and to `github.rest.issues.createComment` at lines 64-68. The local executable reproduction confirmed eligible=true and parsed=NaN for the malformed cases, while the numeric string `'42'` remained eligible and parsed to 42. The smallest practical fix is to validate that the payload is a positive integer before the job proceeds, or to add an explicit early exit in the script before any GitHub API call; the validation should also reject the string sentinel `'-1'` and other non-numeric values.
- **Why this is likely a bug:** The test's expected behavior is to skip or visibly reject malformed values before publication, and the source path contradicts that requirement in an executable way. The gate admits malformed input, `parseInt` converts it to `NaN`, and the result is used as the target for GitHub issue API requests. This is a production workflow defect rather than a browser or simulator artifact because the same behavior follows directly from the checked-in expression and JavaScript parsing semantics. A positive numeric string remains supported, so the targeted fix is input validation at the new gate or immediately before the API calls, not a rewrite of the publication logic.

**Relevant code:**

`.github/workflows/mini-sysbench.yml:14`

~~~yaml
if: ${{ github.event.client_payload.issue_number != -1 }}
~~~

`.github/workflows/mini-sysbench.yml:35-37`

~~~javascript
const { ACTOR, FORMAT, ISSUE_NUMBER, JOB_TYPE, GITHUB_WORKSPACE } = process.env;
const { owner, repo } = context.repo;
const issue_number = parseInt(ISSUE_NUMBER, 10);
~~~

`.github/workflows/mini-sysbench.yml:45-49`

~~~javascript
const { data: comments } = await github.rest.issues.listComments({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo
});
~~~

`.github/workflows/mini-sysbench.yml:64-68`

~~~javascript
await github.rest.issues.createComment({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo,
  body: `${commentMarker}\n@${ACTOR} ${FORMAT}\n${resData}`
});
~~~

aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Get benchmark results

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

View replay

High severity Benchmark results can reach the wrong pull request

What failed: The workflow posted a benchmark result from another pull request to issue 42 instead of rejecting the mismatched object and issue.

Impact · Steps · Stub / mock · Analysis · Why this is likely a bug
  • Severity: High High severity
  • Impact: Reviewers may see benchmark results from a different pull request posted on their issue. This can mislead approval decisions and expose unrelated results across pull requests.
  • Steps to Reproduce:
    1. Provide a valid local result object under the key other-pr/results.log with the content RESULT-FOR-B.
    2. Send a payload with that bucket and key but set the issue number to 42, representing a different pull request.
    3. Run the reporting workflow and inspect the published benchmark comment for issue 42.
    4. Confirm that the workflow exits successfully and the comment contains RESULT-FOR-B instead of rejecting the mismatched identities.
  • Stub / mock content: The run used an isolated local AWS stub and controlled result fixtures to avoid real AWS credentials and services; no production systems or customer data were used.
  • Code Analysis: The changed .github/workflows/mini-sysbench.yml lines 24-29 pass github.event.client_payload.bucket and github.event.client_payload.key independently to aws s3api get-object, so any readable object selected by the payload becomes results.log. In the later github-script at lines 35-40, ISSUE_NUMBER is read from the same payload and parsed separately while results.log is read without checking its key, metadata, producer identity, or issue association. Lines 44-68 then use that independently parsed issue_number for both issues.listComments and issues.createComment/updateComment. The PR diff replaced the old local PR/main benchmark flow with this externally selected S3 handoff, and the new changed path contains no binding, signature, or consistency check. The smallest practical fix is to carry a trusted issue identity with the produced object, verify it against ISSUE_NUMBER before the GitHub API calls, and fail the job before publication when they differ; deriving the target issue from a trusted object key is another targeted option.
  • Why this is likely a bug: The controlled reproduction paired issue 42 with other-pr/results.log, and the workflow returned exit 0 while publishing RESULT-FOR-B to issue 42. This is not explained by the unavailable browser page: the workflow source independently shows that the object contents are read and then sent to the issue number without an identity comparison. A benchmark comment is user-visible evidence used to assess a pull request, so accepting a valid but unrelated object can mislead reviewers and disclose results across pull requests. Rejecting the pair or verifying a trusted binding before list/update/createComment directly prevents the observed failure without requiring a broad redesign.
Relevant code

.github/workflows/mini-sysbench.yml:24-29

- name: Get benchmark results
  id: get-results
  run: aws s3api get-object --bucket="$BUCKET" --key="$KEY" results.log
  env:
    KEY: ${{ github.event.client_payload.key }}
    BUCKET: ${{ github.event.client_payload.bucket }}

.github/workflows/mini-sysbench.yml:35-40

const { ACTOR, FORMAT, ISSUE_NUMBER, JOB_TYPE, GITHUB_WORKSPACE } = process.env;
const { owner, repo } = context.repo;
const issue_number = parseInt(ISSUE_NUMBER, 10);

const fs = require('fs').promises;
const resData = await fs.readFile(`${GITHUB_WORKSPACE}/results.log`, 'utf8');

.github/workflows/mini-sysbench.yml:44-68

const { data: comments } = await github.rest.issues.listComments({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo
});
...
await github.rest.issues.createComment({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo,
  body: `${commentMarker}\n@${ACTOR} ${FORMAT}\n${resData}`
});
Evidence Package
Copy prompt for an agent
Ito QA identified the following failure during automated PR testing. Please investigate and propose a fix.

**High severity — Benchmark results can reach the wrong pull request**

**What failed:** The workflow posted a benchmark result from another pull request to issue 42 instead of rejecting the mismatched object and issue.

- **Impact:** Reviewers may see benchmark results from a different pull request posted on their issue. This can mislead approval decisions and expose unrelated results across pull requests.
- **Steps to reproduce:**
  1. Provide a valid local result object under the key other-pr/results.log with the content RESULT-FOR-B.
  2. Send a payload with that bucket and key but set the issue number to 42, representing a different pull request.
  3. Run the reporting workflow and inspect the published benchmark comment for issue 42.
  4. Confirm that the workflow exits successfully and the comment contains RESULT-FOR-B instead of rejecting the mismatched identities.
- **Stub / mock content:** The run used an isolated local AWS stub and controlled result fixtures to avoid real AWS credentials and services; no production systems or customer data were used.
- **Code analysis:** The changed .github/workflows/mini-sysbench.yml lines 24-29 pass github.event.client_payload.bucket and github.event.client_payload.key independently to aws s3api get-object, so any readable object selected by the payload becomes results.log. In the later github-script at lines 35-40, ISSUE_NUMBER is read from the same payload and parsed separately while results.log is read without checking its key, metadata, producer identity, or issue association. Lines 44-68 then use that independently parsed issue_number for both issues.listComments and issues.createComment/updateComment. The PR diff replaced the old local PR/main benchmark flow with this externally selected S3 handoff, and the new changed path contains no binding, signature, or consistency check. The smallest practical fix is to carry a trusted issue identity with the produced object, verify it against ISSUE_NUMBER before the GitHub API calls, and fail the job before publication when they differ; deriving the target issue from a trusted object key is another targeted option.
- **Why this is likely a bug:** The controlled reproduction paired issue 42 with other-pr/results.log, and the workflow returned exit 0 while publishing RESULT-FOR-B to issue 42. This is not explained by the unavailable browser page: the workflow source independently shows that the object contents are read and then sent to the issue number without an identity comparison. A benchmark comment is user-visible evidence used to assess a pull request, so accepting a valid but unrelated object can mislead reviewers and disclose results across pull requests. Rejecting the pair or verifying a trusted binding before list/update/createComment directly prevents the observed failure without requiring a broad redesign.

**Relevant code:**

`.github/workflows/mini-sysbench.yml:24-29`

~~~yaml
- name: Get benchmark results
  id: get-results
  run: aws s3api get-object --bucket="$BUCKET" --key="$KEY" results.log
  env:
    KEY: ${{ github.event.client_payload.key }}
    BUCKET: ${{ github.event.client_payload.bucket }}
~~~

`.github/workflows/mini-sysbench.yml:35-40`

~~~javascript
const { ACTOR, FORMAT, ISSUE_NUMBER, JOB_TYPE, GITHUB_WORKSPACE } = process.env;
const { owner, repo } = context.repo;
const issue_number = parseInt(ISSUE_NUMBER, 10);

const fs = require('fs').promises;
const resData = await fs.readFile(`${GITHUB_WORKSPACE}/results.log`, 'utf8');
~~~

`.github/workflows/mini-sysbench.yml:44-68`

~~~javascript
const { data: comments } = await github.rest.issues.listComments({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo
});
...
await github.rest.issues.createComment({
  issue_number: issue_number,
  owner: context.repo.owner,
  repo: context.repo.repo,
  body: `${commentMarker}\n@${ACTOR} ${FORMAT}\n${resData}`
});
~~~

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
Main PR
Total 42090 42090
Successful 18940 18940
Failures 23150 23150
Partial Successes1 5340 5340
Main PR
Successful 44.9988% 44.9988%
Failures 55.0012% 55.0012%

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant