Skip to content

chore: add studioctl local configuration#1797

Merged
martinothamar merged 1 commit into
Altinn:mainfrom
martinothamar-agent:feat/studioctl-local-configuration
Jun 5, 2026
Merged

chore: add studioctl local configuration#1797
martinothamar merged 1 commit into
Altinn:mainfrom
martinothamar-agent:feat/studioctl-local-configuration

Conversation

@martinothamar-agent

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Development-only app startup hook that imports local harness configuration from studioctl app env --json --project <app>.
  • Skips the hook when the app was already launched by studioctl via STUDIOCTL_APP_RUN.
  • Keeps app-lib coupled only to studioctl's flat JSON env-var contract and logs warnings instead of failing app startup if studioctl is missing or returns bad output.

Why

This lets IDE/debugger launches get the same local platform configuration as studioctl run, while still keeping studioctl run as the source of truth for local harness values.

Testing

  • Installed/verified studioctl v0.1.0-preview.13.
  • dotnet csharpier check src/Altinn.App.Api/Extensions/WebHostBuilderExtensions.cs src/Altinn.App.Api/Extensions/StudioctlLocalConfiguration.cs test/Altinn.App.Api.Tests/Extensions/WebHostBuilderExtensionsTests.cs
  • dotnet test test/Altinn.App.Api.Tests/Altinn.App.Api.Tests.csproj --filter "FullyQualifiedName~WebHostBuilderExtensionsTests" -v minimal
    • Passed: 9/9.
  • dotnet build solutions/All.sln -v minimal
    • Passed with existing NU1903 warnings in analyzer/benchmark projects.
  • Manual martinotest project-reference smoke test:
    • studioctl run -p /data/home/code/apps/martinotest-app-lib-pr started the app on a random host port and routed through http://local.altinn.cloud:8000/ttd/martinotest/.
    • dotnet run --project App/App.csproj --launch-profile AppRef --no-build imported studioctl config, bound a random host port, and was discoverable through studioctl app ps.

Integration test note

I also reproduced a PDF integration failure locally, but it reproduces the same way on clean upstream/main at 3c666448.

Command:

dotnet test test/Altinn.App.Integration.Tests/Altinn.App.Integration.Tests.csproj --filter "FullyQualifiedName~InstanceLocking.InstanceLockTests.ProcessNext_ConcurrentRequests_OneRequestGetsConflict" -v minimal

Result on both this branch and clean upstream main: the app receives a 500 from localtest-pdf3 after about 30 seconds. PDF container logs show Chromium failing to load frontend CDN assets with ERR_CERT_AUTHORITY_INVALID, then timing out waiting for #readyForPrint:

Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID url:https://altinncdn.no/toolkits/altinn-app-frontend/4/altinn-app-frontend.css
Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID url:https://altinncdn.no/toolkits/altinn-app-frontend/4/altinn-app-frontend.js
Wait condition not satisfied within timeout waitFor="#readyForPrint"
status_code=500 detail="waitFor element not ready within timeout: failed waiting for condition: timeout"

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@martinothamar-agent, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 33 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb9371d7-d6c1-454a-9978-b9afb9d5474b

📥 Commits

Reviewing files that changed from the base of the PR and between 3c66644 and 3ca8502.

📒 Files selected for processing (3)
  • src/Altinn.App.Api/Extensions/StudioctlLocalConfiguration.cs
  • src/Altinn.App.Api/Extensions/WebHostBuilderExtensions.cs
  • test/Altinn.App.Api.Tests/Extensions/WebHostBuilderExtensionsTests.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread src/Altinn.App.Api/Extensions/StudioctlLocalConfiguration.cs Dismissed
Comment thread src/Altinn.App.Api/Extensions/StudioctlLocalConfiguration.cs Dismissed
Comment thread src/Altinn.App.Api/Extensions/StudioctlLocalConfiguration.cs Dismissed
Comment thread src/Altinn.App.Api/Extensions/StudioctlLocalConfiguration.cs Dismissed
@martinothamar martinothamar added kind/chore other A PR that should be in release notes, but as a chore labels Jun 5, 2026
@martinothamar martinothamar changed the title feat: add studioctl local configuration chore: add studioctl local configuration Jun 5, 2026
@martinothamar martinothamar merged commit 56e0709 into Altinn:main Jun 5, 2026
10 of 11 checks passed
@martinothamar-agent martinothamar-agent deleted the feat/studioctl-local-configuration branch June 5, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/chore other A PR that should be in release notes, but as a chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants