Skip to content

Feature/local dry run from working directory#67

Merged
emocharnik merged 9 commits intomainfrom
feature/local-dry-run-from-working-directory
Apr 9, 2026
Merged

Feature/local dry run from working directory#67
emocharnik merged 9 commits intomainfrom
feature/local-dry-run-from-working-directory

Conversation

@emocharnik
Copy link
Copy Markdown
Collaborator

No description provided.

emocharnik and others added 9 commits March 26, 2026 11:04
Adds a new command 'Scalr: Dry Run from Working Directory' that lets
developers trigger a plan-only run directly from their local checkout
without needing to run `terraform init` first (which requires
state-versions:read permission).

Workflow:
- Reads the git remote URL and repo root from the VS Code git API
- Computes the relative working-directory path within the repo
- Fetches Scalr workspaces filtered by VCS repo identifier and
  working-directory, auto-selecting if exactly one matches or prompting
  the user otherwise (caching the choice per directory)
- Archives the git repo root as a tar.gz and uploads it as a dry
  configuration version via the Scalr API
- Creates an is-dry run referencing that configuration version
- Opens the plan log for live monitoring

Also extends git.d.ts with fetchUrl/pushUrl on Remote, adds
getGitRepoInfo() to git.ts, and adds Node.js built-in fallbacks
to the web webpack bundle so it builds cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the 'Dry Run from Working Directory' button to the editor title
bar whenever a Terraform or OpenTofu file is the active editor, making
the command easily discoverable without opening the command palette.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g logging

- Switch configuration version creation to /api/tfe/v2 to get upload-url
  for VCS-backed workspaces (with temporary go-tfe User-Agent workaround
  until backend fix lands)
- Derive working directory from the active editor file path instead of the
  VS Code workspace folder root, so nested module directories resolve correctly
- Exclude .git and .terraform directories from the uploaded archive
- Add Output channel logging throughout: workspace matching candidates,
  CV creation response, upload HTTP status, and per-poll CV status
- Improve error message to always show the working directory

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace $(rocket) with $(play) on the editor title bar button
- Add a CodeLens "▶ Scalr: Dry Run" at the top of every .tf/.tofu file
  so the action is visible directly next to the code without opening
  the command palette or the Scalr sidebar

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
CodeLens only appears at the top of the file and disappears when
scrolled down, making it unreliable. The editor title bar button
(always visible) is sufficient.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Before triggering a run the user is now offered a choice:
- "Current repository" — existing VCS + working-dir matching flow
- "Other workspace…" — for CLI-driven or non-VCS workspaces

The "Other" path lets the user filter by environment (shows an
environment quick-pick, then lists workspaces in that env) or by
workspace name/ID (text input → matching workspaces), and finishes
with a workspace quick-pick before proceeding to upload and run.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ovements

- Add approve/discard actions on plan sub-items for runs awaiting confirmation
- Add cancel button on in-progress run items
- Show bell icon on run and workspace items when approval is needed
- Open apply log automatically after approving a run
- Click plan/apply sub-items to view logs directly (no separate button)
- Remove standalone 'Show Plan/Apply Output' inline buttons
- Auto-refresh workspaces and runs views every 5 seconds
- Trigger immediate refresh when a plan/apply step finishes
- Fix refresh button losing active workspace filter (softRefresh pattern)
- Replace tfe/v2 + go-tfe User-Agent hack with standard SDK createConfigurationVersion
- Replace shell-pipe archiving with execFile git ls-files + tar --files-from
  to respect .gitignore, support .terraformignore, and work correctly on Windows
- Update CHANGELOG for v0.2.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@emocharnik emocharnik merged commit 6ea36dc into main Apr 9, 2026
@emocharnik emocharnik deleted the feature/local-dry-run-from-working-directory branch April 9, 2026 13:50
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.

1 participant