Skip to content

DRC-2642: Rename cr terminology to pr in CLI and SDK#1085

Merged
gcko merged 3 commits intomainfrom
feature/drc-2642-rename-cr-terminology-to-pr-across-repositories
Jan 28, 2026
Merged

DRC-2642: Rename cr terminology to pr in CLI and SDK#1085
gcko merged 3 commits intomainfrom
feature/drc-2642-rename-cr-terminology-to-pr-across-repositories

Conversation

@even-wei
Copy link
Copy Markdown
Contributor

Summary

  • CLI flag: --cr--pr
  • Session type: "cr""pr" in click.Choice(["pr", "prod", "dev"])
  • CIInfo dataclass fields: cr_numberpr_number, cr_urlpr_url
  • API clients: parameter names and session type checks updated
  • CI providers: local variable renames in GitHub Actions and GitLab CI
  • Commands: upload, download, delete updated
  • Tests: all test files updated with new parameter names
  • Documentation: README.md updated

Breaking Changes

  • CLI flag changed from --cr to --pr. Users must update any scripts that use the --cr flag.
  • Session type value changed from "cr" to "pr".

Test plan

  • Pre-commit hooks pass (black, isort, flake8)
  • Run pytest to verify all tests pass

Resolves DRC-2642

🤖 Generated with Claude Code

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>
Comment thread recce_cloud/tests/test_cli.py Outdated
Comment thread recce_cloud/tests/test_cli.py Outdated
Comment thread recce_cloud/tests/test_cli.py Outdated
Comment thread recce_cloud/tests/test_cli.py Outdated
Comment thread recce_cloud/tests/test_cli.py Outdated
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Jan 28, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (15 files)
  • recce_cloud/README.md - 0 issues
  • recce_cloud/recce_cloud/api/base.py - 0 issues
  • recce_cloud/recce_cloud/api/github.py - 0 issues
  • recce_cloud/recce_cloud/api/gitlab.py - 0 issues
  • recce_cloud/recce_cloud/cli.py - 0 issues
  • recce_cloud/recce_cloud/delete.py - 0 issues
  • recce_cloud/recce_cloud/download.py - 0 issues
  • recce_cloud/recce_cloud/upload.py - 0 issues
  • recce_cloud/tests/test_ci_providers.py - 0 issues
  • recce_cloud/tests/test_cli.py - 0 issues
  • recce_cloud/tests/test_platform_clients.py - 0 issues
  • recce_cloud/recce_cloud/ci_providers/github_ci.py - 0 issues
  • recce_cloud/recce_cloud/ci_providers/gitlab_ci.py - 0 issues
  • recce_cloud/recce_cloud/models.py - 0 issues
  • recce_cloud/recce_cloud/ci_providers/base.py - 0 issues
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
recce_cloud/tests/test_cli.py N/A CRITICAL: Typo in test assertion - 'Auto-preate' should be 'Auto-create'
recce_cloud/tests/test_cli.py N/A CRITICAL: Typo in test assertion - 'Auto-preate' should be 'Auto-create'
recce_cloud/tests/test_cli.py N/A CRITICAL: Typo in test assertion - 'Auto-preate' should be 'Auto-create'
recce_cloud/tests/test_cli.py N/A CRITICAL: Typo in test assertion - 'Auto-preate' should be 'Auto-create'
recce_cloud/tests/test_cli.py N/A CRITICAL: Typo in test assertion - 'preation' should be 'creation'

even-wei and others added 2 commits January 28, 2026 10:42
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>
@even-wei even-wei self-assigned this Jan 28, 2026
@even-wei even-wei requested a review from gcko January 28, 2026 03:17
@gcko gcko requested a review from Copilot January 28, 2026 03:20
Copy link
Copy Markdown
Contributor

@gcko gcko left a comment

Choose a reason for hiding this comment

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

LGTM

@gcko gcko merged commit 32b47d0 into main Jan 28, 2026
19 of 20 checks passed
@gcko gcko deleted the feature/drc-2642-rename-cr-terminology-to-pr-across-repositories branch January 28, 2026 03:23
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 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 --cr to --pr and 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_url and 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)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
self.assertNotIn("PR Number:", result.output)

Copilot uses AI. Check for mistakes.
# 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)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
self.assertNotIn("PR Number:", result.output)
self.assertNotIn("CR Number:", result.output)

Copilot uses AI. Check for mistakes.
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.

3 participants