feat: project detection support added#1476
Open
KartikJha wants to merge 1 commit intoDXCDT-1554/common-qs-fields-prefillingfrom
Open
feat: project detection support added#1476KartikJha wants to merge 1 commit intoDXCDT-1554/common-qs-fields-prefillingfrom
KartikJha wants to merge 1 commit intoDXCDT-1554/common-qs-fields-prefillingfrom
Conversation
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.
Changes
internal/cli/quickstart_detect.go(new file)DetectProject(dir string) DetectionResult— scans the working directory for framework signal files and returns a structured result withFramework,Type,BuildTool,Port,AppName,Detected, andAmbiguousCandidatesangular.json,vite.config.ts) take priority over generic dep scanning to avoid false positivesAmbiguousCandidatesis populated so the caller can prompt for disambiguationinternal/cli/quickstarts.goNew
setup-experimentalcommand flow:SetupInputsnamed struct replacing 3x repeated anonymous structsresolveRequestParams()— resolvesDetectionSubplaceholders inRequestParams(callbacks, logout URLs, web origins, name) using actual app name and port at runtimeDetectProject()intoRunE: on an existing project the detected framework/type/build-tool/port/name are shown as a summary and the user is asked to confirm; accepted values pre-fillSetupInputsso downstream prompts are skippedgetQuickstartConfigKeyskips any field already populated (by flags or detection) and only asks for what is missingmanagement.ResourceServer+cli.api.ResourceServer.Create()instead ofmanagement.Client<app-name>-API; API identifier defaults tohttps://<app-name-slug>--app,--api,--name,--type,--framework,--build-tool,--port,--callback-url,--logout-url,--web-origin-url,--identifier,--audience,--signing-alg,--scopes,--token-lifetime,--offline-accessOther fixes applied during review:
RS256overwrite on API signing algorithmAUTH0_SECRET,SESSION_SECRET) now usegenerateState(32)instead of a static placeholderEnvValuesis now sorted for deterministic config file outputgopkg.in/yaml.v2withbuildNestedMap()to correctly produce nested YAML from dot-delimited keys (e.g.okta.oauth2.issuer)auth0.DetectionSubconstantfmt.Printftocli.renderer.Infoffor consistencym2mremoved from the application type selection list"::none"error when only--apiwas selected (config key lookup now correctly skipped for API-only flows)internal/auth0/quickstart.goReferences
setup-experimentalTesting
Manual — existing project:
Manual — empty directory:
Manual — API-only:
auth0 quickstarts setup-experimental --api --identifier https://my-api # Expected: prompts to select an existing app, creates ResourceServer, no app client createdManual — App + API:
Unit tests for
DetectProjectcovering each of the 14 signal rules: N/A (to be added in a follow-up — mockingos.ReadFile/os.Statfor the full matrix is tracked separately).Checklist
--helptext and flag descriptions updated inline)