feat: expose app production URL (apps get) + fix apps list org bug#121
Open
tcerqueira wants to merge 4 commits into
Open
feat: expose app production URL (apps get) + fix apps list org bug#121tcerqueira wants to merge 4 commits into
tcerqueira wants to merge 4 commits into
Conversation
`apps list --org <org>` resolved the org but never forwarded it to the
`apps.listByPage` procedure, so the backend rejected the request with a
MALFORMED_REQUEST error ("org: expected string, received undefined").
Forward the resolved org slug like `deployments list` already does.
Closes the gap from #108: agents/CI with only a token, org slug and app slug had no machine-readable way to discover an app's live production URL. `apps get --org <org> --app <app> --json` returns { slug, productionUrl, domains, productionRevisionId, timelines, ... }. Domains live on revision timelines rather than the app record, so we read the latest revision's timelines and pick the Production-context partition; apps with no deployment yet report a null productionUrl gracefully. A human-readable table is printed in non-json mode.
For #108, the deploy `--json` payload now includes an explicit `productionUrl` (derived from the Production-context timeline) alongside the existing builds-page `url` and `timelines`. `--no-wait --json` previously wrote nothing to stdout; it now emits a JSON object with org/app/revisionId/url and status "pending" so agents can track the in-flight build. Also fixes a latent hang: the upload ProgressBar was constructed unconditionally but only stopped when drawn, so in --json/--quiet mode its render timer kept the event loop alive and the process never exited. The bar is now only instantiated when it will actually be rendered.
Standardize stdout discipline across deploy/apps.ts and deploy/publish.ts: stdout now carries only data payloads (the --json result object, and in human mode the list/query tables and apps-get data), while all post-action confirmations, progress/status chrome, and debug diagnostics go to stderr — in both --json and human modes. publish.ts: the `log()` helper (used for "You can view the revision here", "Loaded previously uploaded files", "Successfully uploaded your application!", "No files were changed…", "Waiting for deployment to complete…", "To see the deployment…") now writes to stderr; the "Successfully deployed" confirmation, per-timeline URL lines, the cancelled/failed notice, and all debug console.log calls were moved to console.error. apps.ts: the "No applications in this organization." notice and the "More results available…" pagination hint moved to stderr; the apps list table and the apps get data display stay on stdout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #108 (machine-readable production URL) plus a related
apps listbug.Changes
Fix:
apps listnever forwardedorgapps list --org <org>resolved the org but omitted it from theapps.listByPagequery, so the backend rejected it withMALFORMED_REQUEST("org: expected string, received undefined"). Now theresolved org slug is forwarded (matching
deployments list).orgs listtakes no org and
deployments listalready forwarded it, so neither wasaffected.
Feat:
apps get(#108)apps get --org <org> --app <app> --jsonreturns{ slug, productionUrl, domains, productionRevisionId, timelines, ... }.Domains live on revision timelines (not the app record), so we read the
latest revision's timelines and select the Production-context partition.
Apps with no deployment report
productionUrl: null. A human-readabletable is shown in non-json mode.
Feat: deploy
--json(#108)deno deploy --jsonnow includes an explicitproductionUrlfield(in addition to the existing builds-page
urlandtimelines).deno deploy --no-wait --jsonpreviously emitted empty stdout; it nowemits a JSON object with
revisionId(statuspending).the event loop alive in
--json/--quietmode, so the process neverexited.
Verification (live, throwaway org)
apps list --org … --json→ exit 0, returns apps.apps get … --json→ correctproductionUrl+domains+timelines.deploy --prod --json→productionUrlpresent, statusrouted, URLserves HTTP 200, exit 0.
deploy --prod --no-wait --json→ emitsrevisionId, exit 0 (~1.7s).