Skip to content

refactor(workspace): rename changeuri to githubpr and simplify request types - #272

Open
xytan0056 wants to merge 4 commits into
mainfrom
refactor/workspace-request-types
Open

refactor(workspace): rename changeuri to githubpr and simplify request types#272
xytan0056 wants to merge 4 commits into
mainfrom
refactor/workspace-request-types

Conversation

@xytan0056

@xytan0056 xytan0056 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move core/changeuri/core/workspace/githubpr/ — it's a GitHub PR URI parser, not a generic change URI package. Lives under workspace since that's its only consumer.
  • Rename gitrequest.gogithubpr_request.go; gitRequestgithubPRRequest; requestIDpr.Number.
  • newGitHubPRRequest accepts a githubpr.PullRequest directly instead of decomposed scalar fields.
  • Simplify NewRequest: single githubpr.Parse call replaces the url.Parse + scheme switch + changeuri.Parse double-parse.
  • Real-git integration tests now go through NewRequest instead of the (now unexported) constructor.

Test plan

CI
local test

@xytan0056
xytan0056 requested review from a team as code owners August 6, 2026 02:23
Comment thread core/workspace/request.go
pr, err := githubpr.Parse(rawURL)
if err != nil {
return nil, err
return nil, fmt.Errorf("invalid change URI %q: %w", rawURL, err)

@xytan0056 xytan0056 Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wrapped as usererror in native_orchestrator.go call site

@xytan0056
xytan0056 force-pushed the refactor/workspace-request-types branch from 20b1d56 to a3e4628 Compare August 6, 2026 03:01
Comment thread core/workspace/githubpr_request.go Outdated
@@ -0,0 +1,80 @@
// Copyright (c) 2025 Uber Technologies, Inc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright (c) 2025 Uber Technologies, Inc.
// Copyright (c) 2026 Uber Technologies, Inc.

…t types

- Move core/changeuri/ to core/workspace/githubpr/ — it's a GitHub PR
  URI parser, not a generic change URI package.
- Rename gitrequest.go to githubpr_request.go; rename gitRequest struct
  to githubPRRequest; rename requestID field to pr.Number.
- newGitHubPRRequest now accepts a githubpr.PullRequest directly
  instead of decomposed scalar fields.
- Simplify NewRequest: single githubpr.Parse call replaces the
  url.Parse + scheme switch + changeuri.Parse double-parse.
@xytan0056
xytan0056 force-pushed the refactor/workspace-request-types branch from a3e4628 to 51d79b2 Compare August 6, 2026 16:27
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.

2 participants