Open axisofentropy opened 2 years ago
For developers:
1) Add the metadata
jsonb field to the deployments
2) Add the --output-json
format to the uffizzi preview list
command
3) Add the --set-label
option to the uffizzi preview create
and uffizzi preview update
. It should be saved in metadata in the following format:
metadata: {
labels: {
github: {
repository: 'feature/#24_my_awesome_feature',
pull_request: {
number: '24',
}
}
}
}
4) Add the --filter
option to uffizzi preview list
5) Update the manuals
Related core task https://github.com/UffizziCloud/uffizzi_app/issues/221
@axisofentropy what fields of deployments should be outputed after preview list
command with --output=json
flag?
for now we outputting just id and metadata(labels)
@the38th For the scope of this task let's only add json output for previews. Let's add all data from deployments to the output.
for qa:
to set label for deployment you need add flag --set-labels(-s) to uffizzi preview create
or uffizzi preview update
commands.
Example of label - --set-labels github.pull_request.number=23
Example for multiple labels - --set-labels="github.pull_request.number=23 github.repository=my_awesome_repository"
to filter list of previews by label you will need to add flag --filter
to uffizzi preview list
command, format of labels for filter the same as for --set-labels
flag
for output previews in json format you will need to add flag --output json
to uffizzi preview list
command
TESTED - OK. Ready for UAT
TESTED on prod - OK.
When creating and updating Uffizzi Resources, especially Preview Deployments, users should be able to "tag" and/or add other arbitrary metadata to the Resource. When listing Resources, users should be able to "query" for results that match specified metadata.
Which service(s) is this request for? Both open-source and platform. CLI to start and maybe web interface soon?
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? Right now our reusable GitHub Actions workflow creates comments on Pull Requests when a Preview is created, and then later refers back to this comment for the Deployment ID as the authoritative association between the Preview and the Pull Request.
Describe the solution you'd like Instead of using GitHub comments to store this association state, I believe we should instead enable metadata i.e. "tagging" for each Uffizzi Deployment. This will enable many user stories we can't yet imagine, beyond simply associating Pull Requests.
We should probably use simple "labels" of key-value pairs. Some useful examples:
github.repository=UffizziCloud/example-voting-app
github.pull_request.number=23
CLI Design
First, we should probably enable a JSON output mode for
uffizzi preview list
and other similar commands. This by itself will enable lots of user stories.Next, add a way for users to specify metadata when running
uffizzi preview create
anduffizzi preview update
. We may also consider auffizzi preview set-label
command?Finally, add an easy way to filter the output of
uffizzi preview list
and otherlist
commands. The immediate goal is for users to list and and all previews that are associated with a particular GitHub Pull Request.For more powerful queries for
uffizzi preview list
and otherlist
commands, we should consider JMESPATH which is becoming a popular JSON query language.Examples of similar behavior:
kubectl get pods --field-selector status.phase=Running
kubectl get pods --selector='status=online'
gcloud compute instances list --filter="machineType:f1-micro"
aws ec2 describe-volumes --query 'Volumes[*].Attachments'
az vm show --resource-group QueryDemo --name TestVM --query "osProfile.linuxConfiguration.ssh.publicKeys"
https://en.wikipedia.org/wiki/Metadata