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: deployment config for expected params and targets #1214

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ecrupper
Copy link
Contributor

Additional context: go-vela/community#1002

This change will allow for the deployment block in Vela pipeline files:

version: "1"

deployment:
    targets: [ dev, stage, prod ]
    parameters:
        foo:
            description: blah
            required: true
            type: string

These configurations can also be templated using the standard template format already existing today in Vela:

version: "1"

templates:
    - name: my-deploy-config
       source: over-there.yml
       type: file

deployment:
    template:
        name: my-deploy-config
        vars:
            regions: [ north, east, west ]

Deployment configurations can also be requested using the new API endpoint:

GET /api/v1/deployments/:org/:repo/config

This will allow for the CLI and UI to validate deployments prior to their launch. However, because you can create deployments in other ways outside the scope of Vela, and Vela still will process the resulting webhook, this PR also validates the incoming deployment against the config and will stop the compilation if there's a mismatch.

@ecrupper ecrupper requested a review from a team as a code owner October 24, 2024 14:23
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 51.19617% with 102 lines in your changes missing coverage. Please review.

Project coverage is 56.84%. Comparing base (f463fc9) to head (9a8884c).

Files with missing lines Patch % Lines
api/deployment/get_config.go 0.00% 56 Missing ⚠️
compiler/native/expand.go 50.00% 14 Missing and 4 partials ⚠️
api/webhook/post.go 0.00% 8 Missing ⚠️
api/build/compile_publish.go 0.00% 6 Missing ⚠️
compiler/native/compile.go 33.33% 4 Missing and 2 partials ⚠️
compiler/types/pipeline/deployment.go 89.28% 4 Missing and 2 partials ⚠️
api/deployment/get.go 0.00% 1 Missing ⚠️
router/deployment.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1214      +/-   ##
==========================================
- Coverage   56.87%   56.84%   -0.04%     
==========================================
  Files         599      602       +3     
  Lines       32856    33050     +194     
==========================================
+ Hits        18687    18787     +100     
- Misses      13535    13621      +86     
- Partials      634      642       +8     
Files with missing lines Coverage Δ
compiler/native/transform.go 95.38% <100.00%> (+0.03%) ⬆️
compiler/template/native/render.go 86.95% <100.00%> (ø)
compiler/types/pipeline/build.go 72.72% <ø> (ø)
compiler/types/yaml/build.go 91.04% <100.00%> (+0.27%) ⬆️
compiler/types/yaml/deployment.go 100.00% <100.00%> (ø)
scm/github/webhook.go 90.12% <100.00%> (+0.04%) ⬆️
api/deployment/get.go 0.00% <0.00%> (ø)
router/deployment.go 0.00% <0.00%> (ø)
api/build/compile_publish.go 0.00% <0.00%> (ø)
compiler/native/compile.go 69.56% <33.33%> (-0.81%) ⬇️
... and 4 more

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