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

fix: RevisionFormField component crashes in 'refs' API returns no tags #4735

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

alexmt
Copy link
Collaborator

@alexmt alexmt commented Nov 2, 2020

Minor fix in RevisionFormField component.

The revisionsRes.branches.concat(revisionsRes.tags) returns ['master', undefined] instead of ['master'] if revisionsRes.tags is undefined.

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
@alexmt
Copy link
Collaborator Author

alexmt commented Nov 2, 2020

@tetchel , can you take a look please?

Copy link
Contributor

@mayzhang2000 mayzhang2000 left a comment

Choose a reason for hiding this comment

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

LGTM

@tetchel
Copy link
Contributor

tetchel commented Nov 3, 2020

Good catch. I expected the backend would send an empty array if there were no tags. Should it be fixed there too?

https://github.com/argoproj/argo-cd/blob/master/util/git/client.go#L360

@alexmt
Copy link
Collaborator Author

alexmt commented Nov 3, 2020

API drops empty array due to omitempty tag.

Tags []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"`

This is the expected behavior. Most fields of Argo CD APIs responses have omitempty tag. The response API looks cleaner, but as a side effect, we have to assume that fields are optional on client-side. It became easier with typescript optional chaining.

@alexmt alexmt merged commit b97f4f7 into argoproj:master Nov 3, 2020
@alexmt alexmt deleted the revision-autocomplete-fix branch November 3, 2020 06:56
terrycorley pushed a commit to terrycorley/argo-cd that referenced this pull request Nov 3, 2020
…zation-generators

* 'master' of github.com:argoproj/argo-cd:
  fix: RevisionFormField component crashes in 'refs' API returns no tags (argoproj#4735)
  docs: add Opensurvey to USERS.md (argoproj#4727)
  docs: correct parameters usage in CLI (argoproj#4725)
  fix: Repo-server has silent unmarshalling errors leading to empty applications (argoproj#4423) (argoproj#4708)
  fix: inject artificial delay between sync waves to better support health assessments (argoproj#4715)
  fix: exclude files listed under exclusions (argoproj#4686)
  feat: support resource actions on CRDs that use status subresources (argoproj#4690)
  feat: Add autocomplete for repo Revisions (argoproj#4645) (argoproj#4713)
  fix: webhook don't refresh apps pointing to HEAD (argoproj#4717)
  feat: Add support for ExecProvider cluster auth (argoproj#4600) (argoproj#4710)
  fix: adding helm values file in New App (argoproj#4635)
  docs: Instructions on `make verify-kube-connect` step when using k3d (argoproj#4687)
  feat:  Annotation based app paths detection in webhooks (argoproj#4699)
  fix: adding commonAnnotations for Kustomize (argoproj#4613)
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.

None yet

3 participants