DRC-2642: Rename cr terminology to pr in CLI and SDK#1085
Conversation
Rename "cr" (change request) to "pr" (pull request) for clarity: - CLI flag: --cr → --pr - Session type: "cr" → "pr" in click.Choice(["pr", "prod", "dev"]) - CIInfo fields: cr_number → pr_number, cr_url → pr_url - API clients: parameter names and session type checks - CI providers: local variable renames - Commands: upload, download, delete updated - Tests: all test files updated with new parameter names The "cr" term confused users who are more familiar with standard "pr" terminology. This change improves clarity while maintaining support for both GitHub PRs and GitLab MRs through the type system. BREAKING CHANGE: CLI flag changed from --cr to --pr. Users must update any scripts that use the --cr flag. DRC-2642 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: even-wei <evenwei@infuseai.io>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (15 files)
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
|
Fix typos in test_cli.py: - "Auto-preate" → "Auto-create" - "preation" → "creation" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: even-wei <evenwei@infuseai.io>
…-across-repositories
There was a problem hiding this comment.
Pull request overview
This PR standardizes terminology in the recce-cloud CLI and SDK from “CR” (change request) to “PR” (pull/merge request), including flags, session types, CI metadata, and docs, while updating all affected tests.
Changes:
- Rename CLI flag
--crto--prand session type value"cr"to"pr"across CLI commands, CI detection, and API clients. - Update CI metadata structures and platform-specific clients (GitHub/GitLab) to use
pr_number/pr_urland the new"pr"session type, propagating through upload, download, and delete workflows. - Refresh corresponding tests and README documentation to align with the new terminology and flag/session-type semantics.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
recce_cloud/tests/test_platform_clients.py |
Updates platform client tests to use pr_number and "pr" session type for GitHub and GitLab clients. |
recce_cloud/tests/test_cli.py |
Adjusts CLI integration tests for upload/download/delete to expect --pr, "pr" session type, and updated PR/MR display text. |
recce_cloud/tests/test_ci_providers.py |
Updates CI provider tests to validate pr_number/pr_url fields and "pr" session type, including override behavior. |
recce_cloud/recce_cloud/upload.py |
Uses ci_info.pr_number/ci_info.pr_url and "pr" semantics when creating/touching and reporting sessions in platform-specific uploads. |
recce_cloud/recce_cloud/download.py |
Switches session lookup and logging to use "pr" session type and pr_number/pr_url when downloading via platform APIs. |
recce_cloud/recce_cloud/delete.py |
Changes delete workflow to treat non---prod deletes as "pr" sessions and pass pr_number/pr_url through to platform APIs. |
recce_cloud/recce_cloud/cli.py |
Renames the --cr flag to --pr, updates click.Choice values to include "pr" instead of "cr", and normalizes all PR/MR-related output and session-type handling. |
recce_cloud/recce_cloud/ci_providers/gitlab_ci.py |
Maps GitLab MR context to pr_number/pr_url and uses "pr" when determining session type. |
recce_cloud/recce_cloud/ci_providers/github_actions.py |
Maps GitHub PR context to pr_number/pr_url and uses "pr" when determining session type. |
recce_cloud/recce_cloud/ci_providers/detector.py |
Updates CI detection/override logic to work with pr overrides and re-determines session type based on pr_number. |
recce_cloud/recce_cloud/ci_providers/base.py |
Changes the CIInfo dataclass and determine_session_type helper to use pr_number/pr_url and "pr" instead of cr. |
recce_cloud/recce_cloud/api/gitlab.py |
Adjusts GitLab API client signatures and behavior to accept pr_number and "pr" session types while still using mr_iid in payloads. |
recce_cloud/recce_cloud/api/github.py |
Adjusts GitHub API client signatures and behavior to accept pr_number and "pr" session types and pass pr_number in query/payload fields. |
recce_cloud/recce_cloud/api/base.py |
Renames abstract API client parameters from cr_number to pr_number and updates docstrings to the new "pr" terminology. |
recce_cloud/README.md |
Updates CLI documentation, option tables, and examples to use --pr and "pr" in place of --cr and "cr". |
| # Prod session should NOT show PR/CR number | ||
| self.assertNotIn("PR Number:", result.output) | ||
| self.assertNotIn("CR Number:", result.output) | ||
| self.assertNotIn("PR Number:", result.output) |
There was a problem hiding this comment.
The two assertions on this block both call assertNotIn("PR Number:", result.output), so the second one is redundant and doesn’t add any coverage. This looks like a leftover from renaming the earlier "CR Number:" check, and you can safely drop one of these lines to keep the test concise.
| self.assertNotIn("PR Number:", result.output) |
| # Prod session should NOT show CR number or PR number | ||
| self.assertNotIn("PR Number:", result.output) | ||
| self.assertNotIn("CR Number:", result.output) | ||
| self.assertNotIn("PR Number:", result.output) |
There was a problem hiding this comment.
Here as well, the two consecutive assertNotIn("PR Number:", result.output) calls are identical, so the second assertion is redundant. It was probably intended to be the old "CR Number:" check; consider removing the duplicate to avoid confusion and keep the test focused.
| self.assertNotIn("PR Number:", result.output) | |
| self.assertNotIn("CR Number:", result.output) |
Summary
--cr→--pr"cr"→"pr"inclick.Choice(["pr", "prod", "dev"])cr_number→pr_number,cr_url→pr_urlBreaking Changes
--crto--pr. Users must update any scripts that use the--crflag."cr"to"pr".Test plan
pytestto verify all tests passResolves DRC-2642
🤖 Generated with Claude Code