Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e0448fb
Updated files for 1.12.5 release
acuanico-tr-galt Nov 5, 2025
aacebde
TRCLI-205 Updated payload format for adding labels, also updated unit…
acuanico-tr-galt Nov 5, 2025
f4303d5
TRCLI-203 Added 503 and 504 error codes on retry list with exponentia…
acuanico-tr-galt Nov 10, 2025
b01ae0c
TRCLI-203 Updated name and property case validation also added unit t…
acuanico-tr-galt Nov 11, 2025
5407833
TRCLI-203 Added parallel pagination feature, also updated unit tests
acuanico-tr-galt Nov 17, 2025
2150e6a
TRCLI-202 Updated file attachment handling and display errors for fai…
acuanico-tr-galt Nov 20, 2025
e567d6d
TRCLI-207 fixed deletion issue when updating test runs, also added un…
acuanico-tr-galt Nov 27, 2025
7f9127c
Update pr-validation.yml
acuanico-tr-galt Nov 27, 2025
fcc9df0
Merge pull request #369 from gurock/fix/TRCLI-205
acuanico-tr-galt Dec 9, 2025
964bd66
Merge branch 'release/1.12.5' into fix/TRCLI-202
acuanico-tr-galt Dec 9, 2025
39fcdbc
Merge pull request #373 from gurock/fix/TRCLI-202
acuanico-tr-galt Dec 9, 2025
fd7f6ac
Merge branch 'release/1.12.5' into fix/TRCLI-203
acuanico-tr-galt Dec 9, 2025
cf0ebcf
Merge pull request #378 from gurock/fix/TRCLI-203
acuanico-tr-galt Dec 9, 2025
41c39fb
Updated readme and changelog for 1.12.5 release
acuanico-tr-galt Dec 9, 2025
86a61f5
Merge branch 'release/1.12.5' into fix/TRCLI-207
acuanico-tr-galt Dec 9, 2025
c6e7592
TRCLI-207 fixed some failing unit tests
acuanico-tr-galt Dec 9, 2025
0f3670f
Merge pull request #375 from gurock/fix/TRCLI-207
acuanico-tr-galt Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 32 additions & 34 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,31 @@ jobs:
PR_BODY="${{ github.event.pull_request.body }}"

# Check if PR title or body contains issue reference
# Accepts: TRCLI-### (JIRA), GIT-### (GitHub), #123 (GitHub), issues/123
if echo "$PR_TITLE $PR_BODY" | grep -qE "TRCLI-[0-9]+|GIT-[0-9]+|#[0-9]+|issues/[0-9]+"; then
echo "issue_found=true" >> $GITHUB_OUTPUT
if echo "$PR_TITLE $PR_BODY" | grep -qE "(TRCLI-[0-9]+|GIT-[0-9]+|#[0-9]+|issues/[0-9]+)"; then
echo "issue_found=true" >> "$GITHUB_OUTPUT"

# Extract the issue key/number
if echo "$PR_TITLE $PR_BODY" | grep -qE "TRCLI-[0-9]+"; then
ISSUE_KEY=$(echo "$PR_TITLE $PR_BODY" | grep -oE "TRCLI-[0-9]+" | head -1)
echo "issue_key=$ISSUE_KEY" >> $GITHUB_OUTPUT
echo "issue_type=JIRA" >> $GITHUB_OUTPUT
echo "issue_key=$ISSUE_KEY" >> "$GITHUB_OUTPUT"
echo "issue_type=JIRA" >> "$GITHUB_OUTPUT"

elif echo "$PR_TITLE $PR_BODY" | grep -qE "GIT-[0-9]+"; then
ISSUE_KEY=$(echo "$PR_TITLE $PR_BODY" | grep -oE "GIT-[0-9]+" | head -1)
echo "issue_key=$ISSUE_KEY" >> $GITHUB_OUTPUT
echo "issue_type=GitHub" >> $GITHUB_OUTPUT
echo "issue_key=$ISSUE_KEY" >> "$GITHUB_OUTPUT"
echo "issue_type=GitHub" >> "$GITHUB_OUTPUT"

elif echo "$PR_TITLE $PR_BODY" | grep -qE "#[0-9]+"; then
ISSUE_KEY=$(echo "$PR_TITLE $PR_BODY" | grep -oE "#[0-9]+" | head -1)
echo "issue_key=$ISSUE_KEY" >> $GITHUB_OUTPUT
echo "issue_type=GitHub" >> $GITHUB_OUTPUT
echo "issue_key=$ISSUE_KEY" >> "$GITHUB_OUTPUT"
echo "issue_type=GitHub" >> "$GITHUB_OUTPUT"

elif echo "$PR_BODY" | grep -qE "issues/[0-9]+"; then
ISSUE_KEY=$(echo "$PR_BODY" | grep -oE "issues/[0-9]+" | head -1)
echo "issue_key=$ISSUE_KEY" >> $GITHUB_OUTPUT
echo "issue_type=GitHub" >> $GITHUB_OUTPUT
echo "issue_key=$ISSUE_KEY" >> "$GITHUB_OUTPUT"
echo "issue_type=GitHub" >> "$GITHUB_OUTPUT"
fi
else
echo "issue_found=false" >> $GITHUB_OUTPUT
echo "issue_found=false" >> "$GITHUB_OUTPUT"
fi

- name: Comment on PR if issue reference missing
Expand All @@ -61,42 +62,38 @@ jobs:
repo: context.repo.repo,
body: `## ⚠️ Missing Issue Reference

This PR does not reference an issue. Please include a reference in either:
This PR does not reference an issue. Please include one.

**JIRA tickets:**
- PR title: "feat(api): TRCLI-123 Add new endpoint"
- PR description: "Resolves TRCLI-123"
**JIRA example:**
- TRCLI-123

**GitHub issues:**
- PR title: "feat(api): GIT-123 Add new endpoint"
- PR description: "Resolves GIT-123" or "Fixes #123"
- Or link to the GitHub issue

This helps with tracking and project management. Thank you!`
**GitHub examples:**
- GIT-123
- Fixes #123
- issues/123`
})

- name: Check PR Description Completeness
id: check_description
run: |
PR_BODY="${{ github.event.pull_request.body }}"

# Check for required sections
if echo "$PR_BODY" | grep -q "Issue being resolved"; then
echo "has_issue=true" >> $GITHUB_OUTPUT
echo "has_issue=true" >> "$GITHUB_OUTPUT"
else
echo "has_issue=false" >> $GITHUB_OUTPUT
echo "has_issue=false" >> "$GITHUB_OUTPUT"
fi

if echo "$PR_BODY" | grep -q "Solution description"; then
echo "has_solution=true" >> $GITHUB_OUTPUT
echo "has_solution=true" >> "$GITHUB_OUTPUT"
else
echo "has_solution=false" >> $GITHUB_OUTPUT
echo "has_solution=false" >> "$GITHUB_OUTPUT"
fi

if echo "$PR_BODY" | grep -q "Steps to test"; then
echo "has_test_steps=true" >> $GITHUB_OUTPUT
echo "has_test_steps=true" >> "$GITHUB_OUTPUT"
else
echo "has_test_steps=false" >> $GITHUB_OUTPUT
echo "has_test_steps=false" >> "$GITHUB_OUTPUT"
fi

- name: Generate PR Validation Summary
Expand All @@ -107,6 +104,7 @@ jobs:
const issueFound = '${{ steps.check_issue.outputs.issue_found }}' === 'true';
const issueKey = '${{ steps.check_issue.outputs.issue_key }}';
const issueType = '${{ steps.check_issue.outputs.issue_type }}';

const hasIssue = '${{ steps.check_description.outputs.has_issue }}' === 'true';
const hasSolution = '${{ steps.check_description.outputs.has_solution }}' === 'true';
const hasTestSteps = '${{ steps.check_description.outputs.has_test_steps }}' === 'true';
Expand All @@ -124,9 +122,9 @@ jobs:
| Solution Description | ${hasSolution ? '✅ Present' : '⚠️ Missing'} |
| Test Steps | ${hasTestSteps ? '✅ Present' : '⚠️ Missing'} |

${issueFound && hasSolution && hasTestSteps ? '✅ All checks passed!' : '⚠️ Some optional sections are missing. Consider adding them for better review context.'}
${issueFound && hasSolution && hasTestSteps
? '✅ All checks passed!'
: '⚠️ Some optional sections are missing.'}
`;

await core.summary
.addRaw(summary)
.write();
await core.summary.addRaw(summary).write();
10 changes: 10 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ This project adheres to [Semantic Versioning](https://semver.org/). Version numb
- **MINOR**: New features that are backward-compatible.
- **PATCH**: Bug fixes or minor changes that do not affect backward compatibility.

## [1.12.5]

_released 12-09-2025

### Fixed
- Added a new option --parallel-pagination for handling large test result uploads with optimized processing and improved error handling.
- Fixed an issue where adding labels to project fails using label add command
- Fixed an issue where failed attachment upload errors (e.g. due to file size being too large) is not displayed in standard output.
- Fixed an issue where test cases are deleted in existing test runs with configs in a test plan

## [1.12.4]

_released 11-03-2025
Expand Down
54 changes: 50 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ trcli
```
You should get something like this:
```
TestRail CLI v1.12.4
TestRail CLI v1.12.5
Copyright 2025 Gurock Software GmbH - www.gurock.com
Supported and loaded modules:
- parse_junit: JUnit XML Files (& Similar)
Expand All @@ -47,7 +47,7 @@ CLI general reference
--------
```shell
$ trcli --help
TestRail CLI v1.12.4
TestRail CLI v1.12.5
Copyright 2025 Gurock Software GmbH - www.gurock.com
Usage: trcli [OPTIONS] COMMAND [ARGS]...

Expand Down Expand Up @@ -79,6 +79,8 @@ Options:
'username:password'.
--noproxy Comma-separated list of hostnames to bypass the proxy
(e.g., localhost,127.0.0.1).
--parallel-pagination Enable parallel pagination for faster case fetching
(experimental).
--help Show this message and exit.

Commands:
Expand Down Expand Up @@ -1094,7 +1096,7 @@ Options:
### Reference
```shell
$ trcli add_run --help
TestRail CLI v1.12.4
TestRail CLI v1.12.5
Copyright 2025 Gurock Software GmbH - www.gurock.com
Usage: trcli add_run [OPTIONS]

Expand Down Expand Up @@ -1218,7 +1220,7 @@ providing you with a solid base of test cases, which you can further expand on T
### Reference
```shell
$ trcli parse_openapi --help
TestRail CLI v1.12.4
TestRail CLI v1.12.5
Copyright 2025 Gurock Software GmbH - www.gurock.com
Usage: trcli parse_openapi [OPTIONS]

Expand Down Expand Up @@ -1341,6 +1343,50 @@ Average time for uploading:
- 2000 test cases was around 460 seconds
- 5000 test cases was around 1000 seconds

### Parallel Pagination (Experimental)

The TestRail CLI includes an experimental `--parallel-pagination` option that significantly improves performance when fetching large numbers of test cases from TestRail. This feature uses parallel fetching to retrieve multiple pages of results concurrently, rather than fetching them sequentially.

#### When to Use Parallel Pagination

Use `--parallel-pagination` when:
- Working with projects that have thousands of test cases
- Fetching test cases takes a long time during operations
- You need faster case matching and validation during result uploads

#### How It Works

When enabled, parallel pagination:
1. Fetches the first page to determine total pages available
2. Uses a thread pool (default: 10 workers set by `MAX_WORKERS_PARALLEL_PAGINATION` in `trcli/settings.py`) to fetch remaining pages concurrently
3. Automatically handles batching to avoid overwhelming the server
4. Combines all results efficiently for processing

#### Usage

Enable parallel pagination by adding the `--parallel-pagination` flag to any command:

```shell
# Enable parallel pagination for faster case fetching during result upload
$ trcli parse_junit -f results.xml --parallel-pagination \
--host https://yourinstance.testrail.io --username <your_username> --password <your_password> \
--project "Your Project"

# Example with parse_robot
$ trcli parse_robot -f output.xml --parallel-pagination \
--host https://yourinstance.testrail.io --username <your_username> --password <your_password> \
--project "Your Project"
```

You can also enable this feature globally by setting `ENABLE_PARALLEL_PAGINATION = True` in `trcli/settings.py`. The CLI flag takes precedence over the settings file.

#### Performance Considerations

- This feature is most beneficial when dealing with large test case repositories (1000+ cases)
- The default worker count is set to 10, which provides a good balance between speed and server load
- For smaller projects with few test cases, the performance improvement may be negligible
- This is an experimental feature - please report any issues you encounter


Contributing
------------
Expand Down
Loading