Skip to content

chore(ci): AB-2181 - otdfctl e2e ci and results integration improvements#3361

Merged
sievdokymov-virtru merged 8 commits intomainfrom
ab-2181-otdfctl-improvements
Apr 23, 2026
Merged

chore(ci): AB-2181 - otdfctl e2e ci and results integration improvements#3361
sievdokymov-virtru merged 8 commits intomainfrom
ab-2181-otdfctl-improvements

Conversation

@sievdokymov-virtru
Copy link
Copy Markdown
Member

@sievdokymov-virtru sievdokymov-virtru commented Apr 22, 2026

Summary

Number of otdfctl e2e improvements:

  • Manual workflow trigger: Added workflow_dispatch input to checks.yaml so the E2E tests can be triggered on demand manually with a custom TestRail run name
  • Single scheduled run: Added scheduled per day run for checks.yaml to run tests in the morning and save CLI test results into TestRail
  • TestRail upload gating: The TestRail result upload and artifact steps in action.yaml now only run on scheduled and manually triggered runs, preventing pollution TestRail with lots of PR and merge-to-main runs.
  • Auto-prefix tolerance in name matching: upload-bats-test-results-to-testrail.sh now strips [Auto] / (Auto) prefixes from mapping file keys before comparison, so TestRail case names can carry those prefixes without breaking the TAP→case-ID lookup.
  • Colored output in upload script: Mapping results now print YES_MAPPING_FOUND (green) / MAPPING_NOT_FOUND (red) for easier visual scanning of the report.
  • New test case IDs: testname-to-testrail-id.virtru.json updated with new case IDs for policy namespaces, obligation triggers, SCS namespace filters, and subject mapping namespace variants.

Covers AB-2181, AB-2168 JIRA tasks.

Test plan

  • Trigger the workflow manually via GitHub Actions UI and verify the custom run name appears in TestRail (post-merge)
  • Confirm scheduled/push-to-main runs still upload results to TestRail (merge/post-merge)
  • Confirm PR runs do not upload results to TestRail (e.g. test run here)
  • Verify test cases with [Auto]/(Auto) prefixes in the mapping file are correctly matched against plain TAP names.
  • Check that mapping logs in stdout shows colored output.

Summary by CodeRabbit

  • New Features

    • Optional input to set a custom TestRail run name for manual workflow runs.
  • Chores

    • Workflows now run daily and support manual dispatch.
    • TestRail integration and related artifact uploads now run only for scheduled or manually-triggered runs.
    • Expanded end-to-end test mappings.
    • Improved test result reporting with case-insensitive matching and clearer mapping status indicators.

@sievdokymov-virtru sievdokymov-virtru requested review from a team as code owners April 22, 2026 10:49
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the end-to-end testing infrastructure for otdfctl. The changes focus on refining the TestRail integration by gating uploads to prevent unnecessary noise during pull request builds, enabling manual workflow triggers for on-demand testing, and improving the robustness of test name matching. Additionally, the update includes expanded test coverage by mapping new test cases to TestRail IDs and improves developer experience through better visual feedback in the CI logs.

Highlights

  • CI Workflow Improvements: Added workflow_dispatch support to the E2E CI pipeline, allowing for manual execution with custom TestRail run names.
  • TestRail Integration Gating: Restricted TestRail result uploads and artifact generation to only occur on the main branch or via manual workflow_dispatch triggers to reduce noise in PR builds.
  • Mapping Logic Enhancement: Updated the TestRail mapping script to automatically strip [Auto] and (Auto) prefixes from test names, improving matching reliability.
  • Visual Feedback: Introduced colored console output for mapping results to facilitate easier log analysis.
  • Test Coverage: Updated the test mapping configuration with new case IDs for policy namespaces, obligation triggers, and SCS namespace filters.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/checks.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


The tests run fast, the logs are clear, With colors bright, we have no fear. From main to manual, the gate is set, To keep our TestRail free from fret.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added comp:ci Github Actions Work size/s labels Apr 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

Added a daily schedule and workflow_dispatch input to CI; made TestRail integration and mapping-report upload conditional on schedule/dispatch events; expanded TestRail mapping JSON with additional entries; and improved TAP-to-TestRail script key normalization, reporting labels, and JSON payload construction.

Changes

Cohort / File(s) Summary
Workflow config
/.github/workflows/checks.yaml
Added on.schedule cron 25 5 * * * and on.workflow_dispatch input testrail-run-name-for-cli-test; pass the input into the otdfctl/e2e action.
E2E composite action
otdfctl/e2e/action.yaml
Made TestRail integration and mapping-report upload steps conditional to run only when github.event_name is schedule or workflow_dispatch.
TestRail mapping JSON
otdfctl/e2e/testrail-integration/samples-for-virtru-instance/testname-to-testrail-id.virtru.json
Added multiple new test-name → TestRail case ID entries (Namespaces, Obligations, Subject Condition Sets, Subject Mapping); fixed trailing-comma.
TestRail upload script
otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh
Normalize mapping keys by lowercasing and stripping leading "[auto] " / "(auto) "; change console/report tokens to YES_MAPPING_FOUND / MAPPING_NOT_FOUND (colorized in console); build results payload objects via jq with numeric ID conversion; use --arg run_name for run lookup and build run-creation payload with jq.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub as GitHub Actions
    participant E2E as otdfctl/e2e composite
    participant Script as upload-bats-test-results.sh
    participant TestRail as TestRail API
    participant Artifacts as GitHub Artifacts

    GitHub->>E2E: trigger (schedule or workflow_dispatch) + inputs
    E2E->>Script: run TAP parsing & mapping (pass run name)
    Script->>Script: normalize names, map to case IDs, build JSON payload
    Script->>TestRail: POST results payload (create/run lookup as needed)
    Script->>Artifacts: upload TAP results (always)
    Script->>Artifacts: upload mapping-report (only for schedule/dispatch)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

size/m

Suggested reviewers

  • alkalescent

Poem

🐰 I hop through CI at break of day,
Stripping prefixes, finding the way,
Mapping tests with colors bright,
JSON tidy, uploads light,
A little hop — and all's OK 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: CI/workflow improvements for otdfctl E2E testing and TestRail results integration, directly supported by the file-level summaries and PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ab-2181-otdfctl-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TestRail integration by restricting specific CI steps to the main branch or manual triggers, adding several new test case mappings, and enhancing the result upload script with colored output and improved name matching. The review feedback highlights several opportunities to improve the robustness of the shell script, specifically by using printf to handle special characters in test names, utilizing jq to prevent JSON injection when building result arrays, and ensuring that prefix stripping is applied symmetrically during test name lookups.

Comment thread otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh Outdated
Comment thread otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh (1)

71-108: 🧹 Nitpick | 🔵 Trivial

Prefix stripping is correct but asymmetric — consider stripping prefixes from the TAP name too.

ltrimstr is applied only to the mapping key. That's fine for the stated goal (tolerate [Auto] /(Auto) prefixes in TestRail case names stored in the mapping). However, if a TAP test name ever carries an [Auto] or (Auto) prefix (e.g., future bats naming convention), the lookup will fail because $n (the lowercased TAP name) won't match a plain mapping key. If you want true symmetry, also strip the prefixes from $n before comparison:

♻️ Optional symmetric trim
-  lowercasename=$(echo "$name" | tr '[:upper:]' '[:lower:]')
+  lowercasename=$(echo "$name" | tr '[:upper:]' '[:lower:]')
+  # Strip optional auto-prefixes from the TAP name as well
+  lowercasename="${lowercasename#\[auto\] }"
+  lowercasename="${lowercasename#(auto) }"

Also note: the chained ltrimstr("[auto] ") | ltrimstr("(auto) ") strips at most one of each prefix and only in that order; a key like "(auto) [auto] foo" would only have "(auto) " removed. Acceptable given current data, but worth being aware of.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh`
around lines 71 - 108, The lookup_case_id function applies ltrimstr to mapping
keys but not to the TAP name ($n), causing mismatches if TAP names include
“[Auto] ” or “(Auto) ”; update both jq expressions (nested and flat branches) to
normalize $n as well (e.g., use ($n | ascii_downcase | ltrimstr("[auto] ") |
ltrimstr("(auto) ")) in the comparison) so the TAP name has the same prefix
stripping and case-folding as the mapping keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh`:
- Around line 71-108: The lookup_case_id function applies ltrimstr to mapping
keys but not to the TAP name ($n), causing mismatches if TAP names include
“[Auto] ” or “(Auto) ”; update both jq expressions (nested and flat branches) to
normalize $n as well (e.g., use ($n | ascii_downcase | ltrimstr("[auto] ") |
ltrimstr("(auto) ")) in the comparison) so the TAP name has the same prefix
stripping and case-folding as the mapping keys.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 88882b42-36f8-447f-8829-7cd66d3858da

📥 Commits

Reviewing files that changed from the base of the PR and between 176f317 and e59e5d9.

📒 Files selected for processing (4)
  • .github/workflows/checks.yaml
  • otdfctl/e2e/action.yaml
  • otdfctl/e2e/testrail-integration/samples-for-virtru-instance/testname-to-testrail-id.virtru.json
  • otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the otdfctl E2E CI ↔ TestRail integration by enabling manual runs with a custom TestRail run name, reducing TestRail noise from non-main runs, and making TAP→case-ID mapping more tolerant and readable.

Changes:

  • Add workflow_dispatch input plumbing so the E2E suite can be run manually with a custom TestRail run name.
  • Gate TestRail upload + mapping-report artifact upload to only run on main or workflow_dispatch.
  • Improve TestRail mapping robustness (strip [Auto] / (Auto) prefixes during lookup), add colored mapping output, and update the Virtru mapping JSON with new case IDs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh Adds colorized mapping output and makes name matching tolerant of [Auto] / (Auto) prefixes.
otdfctl/e2e/testrail-integration/samples-for-virtru-instance/testname-to-testrail-id.virtru.json Adds new TestRail case ID mappings for additional E2E tests.
otdfctl/e2e/action.yaml Gates TestRail integration + artifact upload to main branch or manual dispatch.
.github/workflows/checks.yaml Adds manual dispatch input and passes it through to the composite E2E action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/checks.yaml
Comment thread otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 135.928889ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 67.839626ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 338.492564ms
Throughput 295.43 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 33.263225411s
Average Latency 330.763851ms
Throughput 150.32 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 191.844087ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 101.502266ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 411.07582ms
Throughput 243.26 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.357652399s
Average Latency 421.932466ms
Throughput 118.04 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 193.413467ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 100.955ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 410.134374ms
Throughput 243.82 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.70816794s
Average Latency 435.128919ms
Throughput 114.40 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 171.248751ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 90.567644ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 436.862195ms
Throughput 228.91 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.813693635s
Average Latency 426.166087ms
Throughput 116.79 requests/second

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
otdfctl/e2e/action.yaml (1)

75-90: ⚠️ Potential issue | 🟠 Major

Include push-to-main in the TestRail guards.

These conditions only allow schedule and workflow_dispatch, so normal push runs on main skip TestRail upload and the mapping report, contrary to the PR objective.

🐛 Proposed fix
     - name: Integrate Bats test results into TestRail
-      if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
+      if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
       shell: bash
       working-directory: otdfctl
       run: |
         cd e2e
@@
     - name: Upload TestRail mapping report
-      if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
+      if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
       uses: actions/upload-artifact@v4
       with:
         name: test-cases-mapping-report
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@otdfctl/e2e/action.yaml` around lines 75 - 90, The workflow steps "Integrate
Bats test results into TestRail" and "Upload TestRail mapping report" are gated
to only run on schedule or workflow_dispatch; update their if conditions to also
allow pushes to main by adding a check for github.event_name == 'push' &&
github.ref == 'refs/heads/main' (or equivalently include github.ref ==
'refs/heads/main') so normal pushes to main execute these steps; update the if
expressions for those two step names accordingly.
otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh (1)

150-163: ⚠️ Potential issue | 🟠 Major

Escape RUN_NAME before using workflow-dispatch input in jq/JSON.

RUN_NAME is set from the user-controllable workflow input testrail-run-name-for-cli-test. Values with special characters like QA "smoke" break the jq filter on line 153 and the JSON body on line 162. Use jq --arg and --argjson to safely interpolate these values.

🛡️ Proposed fix
 find_existing_run() {
   curl -s -u "$TESTRAIL_USER:$TESTRAIL_PASS" \
     "$TESTRAIL_URL/index.php?/api/v2/get_runs/$PROJECT_ID" |
-    jq ".runs[] | select(.name==\"$RUN_NAME\") | .id" | head -n1
+    jq --arg run_name "$RUN_NAME" '.runs[] | select(.name == $run_name) | .id' | head -n1
 }
 
 create_run() {
-  local case_ids_json
+  local case_ids_json payload
   case_ids_json=$(printf '%s\n' "${results[@]}" | jq -s '.[].case_id' | jq -s .)
+  payload=$(jq -n \
+    --arg name "$RUN_NAME" \
+    --argjson case_ids "$case_ids_json" \
+    '{name: $name, include_all: false, case_ids: $case_ids}')
 
   curl -s -u "$TESTRAIL_USER:$TESTRAIL_PASS" \
     -H "Content-Type: application/json" \
-    -d "{\"name\": \"$RUN_NAME\", \"include_all\": false, \"case_ids\": $case_ids_json}" \
+    -d "$payload" \
     "$TESTRAIL_URL/index.php?/api/v2/add_run/$PROJECT_ID" | jq .id
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh`
around lines 150 - 163, The RUN_NAME value is user-controlled and not escaped,
which breaks the jq filter in find_existing_run and the JSON payload in
create_run; update find_existing_run to pass RUN_NAME into jq with --arg (e.g.,
use jq --arg run "$RUN_NAME" '.runs[] | select(.name==$run) | .id') and rebuild
the create_run payload with jq -n using --arg for name and --argjson for the
case_ids array (generate case_ids_json as a proper JSON array and then call jq
-n --arg name "$RUN_NAME" --argjson case_ids "$case_ids_json" '{name: $name,
include_all: false, case_ids: $case_ids}' to produce the -d body) so all
interpolations are safely escaped; apply changes in the functions
find_existing_run and create_run.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@otdfctl/e2e/action.yaml`:
- Around line 75-90: The workflow steps "Integrate Bats test results into
TestRail" and "Upload TestRail mapping report" are gated to only run on schedule
or workflow_dispatch; update their if conditions to also allow pushes to main by
adding a check for github.event_name == 'push' && github.ref ==
'refs/heads/main' (or equivalently include github.ref == 'refs/heads/main') so
normal pushes to main execute these steps; update the if expressions for those
two step names accordingly.

In `@otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh`:
- Around line 150-163: The RUN_NAME value is user-controlled and not escaped,
which breaks the jq filter in find_existing_run and the JSON payload in
create_run; update find_existing_run to pass RUN_NAME into jq with --arg (e.g.,
use jq --arg run "$RUN_NAME" '.runs[] | select(.name==$run) | .id') and rebuild
the create_run payload with jq -n using --arg for name and --argjson for the
case_ids array (generate case_ids_json as a proper JSON array and then call jq
-n --arg name "$RUN_NAME" --argjson case_ids "$case_ids_json" '{name: $name,
include_all: false, case_ids: $case_ids}' to produce the -d body) so all
interpolations are safely escaped; apply changes in the functions
find_existing_run and create_run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1f5b6f93-8739-4328-b2a4-1baebcc5091b

📥 Commits

Reviewing files that changed from the base of the PR and between e59e5d9 and 89ac6e7.

📒 Files selected for processing (3)
  • .github/workflows/checks.yaml
  • otdfctl/e2e/action.yaml
  • otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh

Comment thread .github/workflows/checks.yaml Outdated
c-r33d
c-r33d previously approved these changes Apr 22, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/checks.yaml:
- Around line 578-579: The TestRail run name input is passed verbatim into
TESTRAIL_CLI_RUN_NAME and later interpolated into RUN_NAME inside
upload-bats-test-results-to-testrail.sh (lines around 153 and 162), which breaks
jq filters and JSON when the name contains quotes, backslashes, or newlines; fix
by changing the script to construct jq queries and JSON safely using jq --arg
(for filters) and jq -n (for payloads) instead of string interpolation, i.e.,
replace direct interpolation of RUN_NAME into jq filters/JSON with jq --arg
runName "$RUN_NAME" '... $runName ...' and jq -n --arg runName "$RUN_NAME"
'{name: $runName, ...}' so all special characters are escaped correctly.
- Around line 21-24: The workflow-level schedule and workflow_dispatch cause
every job (including go matrix, integration, benchmark, BDD, xtest, buflint,
license, and otdfctl-test) to run on schedule/dispatch; either scope triggers to
only the CLI/TestRail job or protect non-CLI jobs with job-level guards. Fix by
moving the cron/workflow_dispatch to a dedicated workflow for the CLI
E2E/TestRail run, or add job-level if conditions (e.g., if: github.event_name ==
'pull_request' or a more specific check) on non-CLI jobs such as the go-matrix,
integration, benchmark, BDD, xtest, buflint, and license jobs so they do not run
on scheduled/manual events; ensure comment-govulncheck and comment-benchmark
retain their existing PR-specific if logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38d1404f-f512-477a-8ee5-3581b806a38a

📥 Commits

Reviewing files that changed from the base of the PR and between 89ac6e7 and 45e0ded.

📒 Files selected for processing (1)
  • .github/workflows/checks.yaml

Comment thread .github/workflows/checks.yaml
Comment thread .github/workflows/checks.yaml
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 184.122499ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 106.215135ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 397.184391ms
Throughput 251.77 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.022470547s
Average Latency 428.255058ms
Throughput 116.22 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 177.335701ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 98.304581ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 404.492738ms
Throughput 247.22 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.18088963s
Average Latency 420.362043ms
Throughput 118.54 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 179.369693ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 99.570058ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 402.373399ms
Throughput 248.53 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.280672279s
Average Latency 421.241993ms
Throughput 118.26 requests/second

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh`:
- Around line 150-153: The pipeline in find_existing_run uses jq piped to head
-n1 which can cause the script to fail under pipefail if head exits before jq
finishes; remove the external head usage and let jq return only the first match
itself (e.g., use jq's first/limit construct in the query that currently reads
'.runs[] | select(.name == $run_name) | .id'), keep the same variables
(RUN_NAME, PROJECT_ID, TESTRAIL_URL) and ensure the curl -> jq pipeline exits
cleanly without relying on head.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ee702087-a01c-42e8-a7e9-9d5add836c05

📥 Commits

Reviewing files that changed from the base of the PR and between 45e0ded and 51d5706.

📒 Files selected for processing (1)
  • otdfctl/e2e/testrail-integration/upload-bats-test-results-to-testrail.sh

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • examples
  • otdfctl
  • sdk
  • service
  • lib/fixtures
  • tests-bdd

See the workflow run for details.

@sievdokymov-virtru sievdokymov-virtru added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 90e24f1 Apr 23, 2026
44 checks passed
@sievdokymov-virtru sievdokymov-virtru deleted the ab-2181-otdfctl-improvements branch April 23, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:ci Github Actions Work size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants