Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(c/v3-cli): ddn supergraph build create && apply simultaneously #10682

Open
jjangga0214 opened this issue Feb 13, 2025 · 1 comment
Open
Labels
c/v3-cli k/enhancement New feature or improve an existing feature

Comments

@jjangga0214
Copy link
Contributor

jjangga0214 commented Feb 13, 2025

Component

c/v3-cli

Is your proposal related to a problem?

Hi!

ddn supergraph build create 
ddn supergraph build apply <build version>

The problem is build version is unpredictable before creating a new build.
So a user has to parse stdout to apply automatically(e.g. CI).

Describe the solution you'd like

Let a user provide a predictable identifier.
Users can set it to any value they want.
For example, like a gitsha.

ddn supergraph build create --alias abcd123
ddn supergraph build apply --alias abcd123

Describe alternatives you've considered

Creating build and applying simultaneously.

ddn supergraph build create --apply
@jjangga0214 jjangga0214 added the k/enhancement New feature or improve an existing feature label Feb 13, 2025
@robertjdominguez
Copy link
Contributor

Hiya, @jjangga0214

I'll pass this onto our CLI team, but I do want to suggest a workaround in your CI:

  • You can set the output format for CLI commands; while the default is table, you can also set JSON
  • From there, I used jq to parse the response in CI and then apply the build — as an example, here's what I do in an internal project to log information in "preview" builds of the supergraph:
      # Build and deploy the connectors & supergraph
      - name: Build and deploy the supergraph
        run: |
          cd ddn
          ddn context set-current-context staging
          ddn supergraph build create --description "Build for commit ${{ github.sha }}" --out=json > build_output.json

      - name: Extract URLs from JSON
        id: extract_urls
        run: |
          cd ddn
          BUILD_URL=$(jq -r '.build_url' build_output.json)
          CONSOLE_URL=$(jq -r '.console_url' build_output.json)
          echo "build_url=$BUILD_URL" >> $GITHUB_ENV
          echo "console_url=$CONSOLE_URL" >> $GITHUB_ENV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/v3-cli k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants