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

Enable navigation from a UI to the Git source of a resource #1179

Open
marians opened this issue Jun 21, 2022 · 12 comments
Open

Enable navigation from a UI to the Git source of a resource #1179

marians opened this issue Jun 21, 2022 · 12 comments
Labels
epic/gitops honeybadger/ui In Team Honeybadger and dealing with user interfaces lucas needs/information Requires additional information to be actionable needs/refinement Needs refinement in order to be actionable team/honeybadger Team Honey Badger ux/productivity About how fast users can reach their goals with our help

Comments

@marians
Copy link
Member

marians commented Jun 21, 2022

User story

  • As a cluster admin, I want to quickly identify and access the definition of a GitOps-managed resource, e. g. workload cluster, node pool, or app. This way I can inspect details and start modifications.

Details

In user interfaces like our web UI we want to offer users a way to quickly navigate to the Git source defining the resource, given that the resource is managed in a GitOps way.

Using our own cluster c68pn in installation gollum as an example, the URL would be:

https://github.com/giantswarm/workload-clusters-fleet/tree/main/management-clusters/gollum/organizations/giantswarm/workload-clusters/c68pn/cluster

For the docs app, the URL would be:

https://github.com/giantswarm/workload-clusters-fleet/tree/main/management-clusters/gollum/organizations/giantswarm/workload-clusters/c68pn/apps/docs

@marians
Copy link
Member Author

marians commented Jun 21, 2022

We talked about this one today. You seemed to have an idea on the solution. Could you please add some notes regarding that while the memory is still fresh? @ljakimczuk Thank you!

@ljakimczuk
Copy link

Hey @marians, the support for something like this has been added in this PR, though this may not be the perfect solution, depending on the use case I guess. The originAnnotation seems to be given value relative to the kustomization.yaml path, and I think it may be hard to build the absolute path based on it.

@marians
Copy link
Member Author

marians commented Jun 28, 2022

I can't find any documentation for what originAnnotations produces. Can you point me somewhere? And is it in action somewhere?

@kuosandys kuosandys added ux/productivity About how fast users can reach their goals with our help needs/information Requires additional information to be actionable labels Jun 28, 2022
@ljakimczuk
Copy link

ljakimczuk commented Jun 28, 2022

Sure, you can try it yourself in the gitops-template repository, for example use the script we put in there to generate some resources, for example:

> ./tools/fake-flux-build build MC_NAME ORG_NAME WC_NAME_NO_OUT_OF_BAND apps/hello-world
apiVersion: application.giantswarm.io/v1alpha1
kind: App
metadata:
  annotations:
    config.kubernetes.io/origin: |
      path: appcr.yaml
  name: hello-world
  namespace: org-
spec:
  catalog: giantswarm
  kubeConfig:
    inCluster: false
  name: hello-world-app
  namespace: hello-world
  version: 0.2.0

As you can see, the annotation is included in the final manifest, though it has little value because it points to the path relative to the kustomization.yaml, which in this case lives in the same directory as appcr.yaml.

About the docs, I haven't found good ones myself, but the help command explains it to some degree:

> kustomize edit set buildmetadata --help
Sets one or more buildMetadata options to the kustomization.yaml in the current directory.
Existing options in the buildMetadata field will be replaced entirely by the new options set by this command.
The following options are valid:
  - originAnnotations
  - transformerAnnotations
  - managedByLabel
originAnnotations will add the annotation config.kubernetes.io/origin to each resource, describing where
each resource originated from.
transformerAnnotations will add the annotation alpha.config.kubernetes.io/transformations to each resource,
describing the transformers that have acted upon the resource.
managedByLabel will add the label app.kubernetes.io/managed-by to each resource, describing which version
of kustomize managed the resource.

@marians
Copy link
Member Author

marians commented Jun 29, 2022

Looks like that's indeed not helping us. We need a different solution then.

@ljakimczuk
Copy link

I will check if there is something on the Flux's side that we could use.

@marians
Copy link
Member Author

marians commented Sep 30, 2022

@ljakimczuk Any update on this?

We have #624 in place now and offering a link to e. g. the GitHub UI for the repo would be a great improvement.

@ljakimczuk
Copy link

Unfortunately there is nothing that can give the absolute path to the file in the repository.

@marians
Copy link
Member Author

marians commented Sep 30, 2022

Is there at least a label or annotation or some source for the repo URL (without path)?

@ljakimczuk
Copy link

None that I'm aware of. You can however locate the Kustomization thanks to the annotations you already have, and in this Kustomization find the reference to the source, and then get the URL from the source. See @uvegla comment in the ticket you linked: #624 (comment)

@marians
Copy link
Member Author

marians commented Sep 30, 2022

That looks promosing, thanks!

@weatherhog weatherhog added team/honeybadger Team Honey Badger honeybadger/ui In Team Honeybadger and dealing with user interfaces labels Jul 19, 2023
@marians
Copy link
Member Author

marians commented Jun 18, 2024

@gusevda We talked about this yesterday.

I want to pick this up again and spec what we want to achieve, from the user perspective.

@marians marians added the needs/refinement Needs refinement in order to be actionable label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/gitops honeybadger/ui In Team Honeybadger and dealing with user interfaces lucas needs/information Requires additional information to be actionable needs/refinement Needs refinement in order to be actionable team/honeybadger Team Honey Badger ux/productivity About how fast users can reach their goals with our help
Projects
Status: Backlog 📦
Development

No branches or pull requests

4 participants