Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Provide the dynamic_payload field #389

Merged
merged 4 commits into from
Mar 26, 2022
Merged

Provide the dynamic_payload field #389

merged 4 commits into from
Mar 26, 2022

Conversation

noahingh
Copy link
Member

@noahingh noahingh commented Mar 20, 2022

This PR allows the payload to be posted dynamically when a user deploys. To validate the payload, a user should define
the dynamic_payload field includes the schema for the post body, and if the validation has failed, it returns the bad response.

Ex.

dynamic_payload:
  enabled: true
  inputs:
    strategy:
      required: true  # Validate the field exists.
      type: select # Validate the type of value
      options:
      - default
      - canary
      - blue-green
       description: 'Deploy Strategy' # Describe the field
       default: 'default'  # Hints about default values.

@noahingh noahingh added component: ui This issue or pull request is related to the feature of the UI-side component: server This issue or pull request is related to the feature of the server-side enhancement New feature or request labels Mar 20, 2022
@noahingh noahingh added this to the v0.7 milestone Mar 20, 2022
@noahingh noahingh linked an issue Mar 20, 2022 that may be closed by this pull request
@noahingh noahingh added component: ui This issue or pull request is related to the feature of the UI-side and removed component: ui This issue or pull request is related to the feature of the UI-side labels Mar 20, 2022
Comment on lines +29 to +30
field.JSON("dynamic_payload", map[string]interface{}{}).
Optional(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the dynamic_payload field to send the same payload after review process.

Comment on lines +16 to +21
// If there is a dynamic payload, set it as the payload.
payload := env.Payload
if d.DynamicPayload != nil {
payload = d.DynamicPayload
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a dynamic payload, set it as the payload for deployment API.

@noahingh noahingh marked this pull request as ready for review March 26, 2022 09:35
@noahingh noahingh merged commit 7c1cdbd into main Mar 26, 2022
@noahingh noahingh deleted the dynamic-payload branch March 26, 2022 09:37
@noahingh noahingh added the schema-migration This pull request has a schema-migration label Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: server This issue or pull request is related to the feature of the server-side enhancement New feature or request schema-migration This pull request has a schema-migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input payload dynamically when a user deploy
1 participant