Skip to content

fix: reserve core operational labels in provider requests - #1826

Merged
skevetter merged 1 commit into
mainfrom
fix/reserve-operational-labels
Nov 12, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/reserve-operational-labels

Conversation

@skevetter

@skevetter skevetter commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@netlify

netlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev ready!

Name Link
🔨 Latest commit 9b7b551
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6af536b80e05eb798ddacf88
😎 Deploy Preview https://deploy-preview-1826--devsydev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds shared reserved-label constants and validation, applies validation to workspace, external-provider, and Kubernetes label inputs, and updates existing label declarations to use the shared constants. Documentation describes which label inputs are rejected or remain supported.

Changes: Reserved label validation

Layer / File(s) Summary
Shared label contract
pkg/config/reserved_labels.go, pkg/config/reserved_labels_test.go, pkg/devcontainer/compose_metadata.go, pkg/devcontainer/config_overlay_lifecycle.go, pkg/devcontainer/metadata/metadata.go, pkg/devcontainer/wslg.go, pkg/driver/microsandbox/microsandbox.go, sites/docs-devsy-sh/content/docs/developing-in-workspaces/devcontainer-json.mdx
Defines reserved label keys and validates user-supplied label keys. Existing label declarations now use shared constants. Documentation describes rejected inputs and supported labels.
Workspace and external-provider validation
cmd/workspace/up/up_validate.go, pkg/devcontainer/run.go, pkg/devcontainer/reserved_labels_test.go, pkg/driver/external/run_image.go, pkg/driver/external/reserved_labels_test.go
Workspace entry points validate identity labels. External-provider request construction validates identity labels and adds workspace labels before validation or execution. Tests cover reserved labels and runtime label handling.
Kubernetes label validation
pkg/driver/kubernetes/run.go, pkg/driver/kubernetes/reserved_labels_test.go
Kubernetes preflight and label collection validate merged template and provider labels before adding Devsy labels. Tests cover reserved and ordinary labels.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • devsy-org/devsy#1503: Defines and writes the WSLg snapshot label that this change centralizes and adds to the reserved-label validation.
Merge Risk: Minimal · up to 9b7b5

The change rejects reserved labels before they are merged into provider requests, and ordinary labels keep working. No merge-blocking risk was found. Native argument hardening is a documented follow-up outside this change.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The pull request has no description. The objectives state that the change rejects reserved user-supplied labels before explicit driver or provider map merges while preserving configurable identity and… Add a pull request description that follows the repository template. Include: (1) a Conventional Commits title, such as "fix(config): reserve core operational labels in provider requests"; (2) a "What and why" section that states the proble…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title uses a Conventional Commits prefix (fix:) and names the main change: reserved core operational labels are now rejected in provider requests. The raw summary shows that ValidateUserLabels rej…
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.
Full details: Title check

Explanation

The title uses a Conventional Commits prefix (fix:) and names the main change: reserved core operational labels are now rejected in provider requests. The raw summary shows that ValidateUserLabels rejects reserved keys in IDLabels, and driver and Kubernetes map merges also reject them, so the title matches the changeset.

Full details: Description check

Explanation

The pull request has no description. The objectives state that the change rejects reserved user-supplied labels before explicit driver or provider map merges while preserving configurable identity and metadata labels. They also report test, lint, and vet results and exclude native argument hardening. The description does not include the repository template sections.

Resolution

Add a pull request description that follows the repository template. Include: (1) a Conventional Commits title, such as "fix(config): reserve core operational labels in provider requests"; (2) a "What and why" section that states the problem and scope; (3) a "Fixes" or "Refs" line with the related issue, or "none"; (4) the applicable "Type of change" checkbox, such as "Bug fix"; (5) an "AI assistance" section with the tool, model, and share of generated code; (6) a "Testing" section with the Ginkgo e2e spec or a reason for not adding one, plus the commands run and their results; (7) the checklist items, including mise run cli:lint:ci and mise run cli:test; and (8) "Notes for reviewers" stating that native argument hardening is excluded and the reported positional-image bypass is a follow-up. Remove unused template sections and placeholders.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6c7cf4a5-86e1-420b-8d9a-47bf471dd20b
Commits

Reviewing files that changed from the base of the PR and between beae6d9 and 9b7b551.

Files selected for processing: 15

  • cmd/workspace/up/up_validate.go
  • pkg/config/reserved_labels.go
  • pkg/config/reserved_labels_test.go
  • pkg/devcontainer/compose_metadata.go
  • pkg/devcontainer/config_overlay_lifecycle.go
  • pkg/devcontainer/metadata/metadata.go
  • pkg/devcontainer/reserved_labels_test.go
  • pkg/devcontainer/run.go
  • pkg/devcontainer/wslg.go
  • pkg/driver/external/reserved_labels_test.go
  • pkg/driver/external/run_image.go
  • pkg/driver/kubernetes/reserved_labels_test.go
  • pkg/driver/kubernetes/run.go
  • pkg/driver/microsandbox/microsandbox.go
  • sites/docs-devsy-sh/content/docs/developing-in-workspaces/devcontainer-json.mdx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@netlify

netlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 9b7b551
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6af536b81db8ae356e0cb903

@skevetter

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge within its documented explicit-label scope.

Summary

The PR reserves core operational labels while keeping custom identity and metadata labels configurable.

  • Devsy rejects reserved identification labels before workspace startup and external requests.
  • Kubernetes rejects reserved labels from pod templates and provider settings.

No actionable issues were found.

Acknowledged scope: skevetter explicitly deferred native argument hardening and documented the positional-image bypass. Native argument parity and protection against arbitrary clients are not claimed by this PR.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[User identity labels] --> B[Reject reserved keys]
  B --> C[Assemble external request]
  D[Generated operational labels] --> C
  C --> E[Validate request]
  E --> F[Create workspace]
  G[Kubernetes provider and template labels] --> H[Reject reserved keys]
  H --> I[Add generated Kubernetes labels]
  I --> J[Create resources]
Loading

Reviews (1) · Last reviewed commit: "fix: reserve core operational labels in ..." · Reviewed by Greptile

@skevetter

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@skevetter

Copy link
Copy Markdown
Contributor Author

The four-section body and omission of tracker references follow the requested delivery rules. I retained that format and added explicit Ginkgo test status rather than additional template headings. No new Ginkgo specs were added: the namespace regression is covered by the real child-process gRPC runtime harness and CLI rejection/control runs, while the existing hosted integration matrix passed. Native positional-image argument hardening remains the owner follow-up documented in Not verified.

@skevetter
skevetter marked this pull request as ready for review November 12, 2026 05:21
@skevetter
skevetter merged commit 6ce1bc8 into main Nov 12, 2026
77 checks passed
@skevetter
skevetter deleted the fix/reserve-operational-labels branch November 12, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant