tektoncd / results

Long term storage of execution results.
Apache License 2.0
77 stars 73 forks source link

fix syntax error with tekton results data model diagram #708

Closed cmorinupgrade closed 7 months ago

cmorinupgrade commented 7 months ago

Changes

Mermaid does not support titles for graph. If we want to have a title we would need to proceed with:

graph BT
  title[Tekton Results Data Model]
  B(TaskRun) --> |Record| A[Result]
  C(Log) --> |Record| A
  D(PipelineRun) --> |Record| A

which would produce:

image

However, there is a header just above the diagram so the title is redundant.

I propose that we remove the title completely.

/kind docs

Release Notes

docs: Fix mermaid.js diagram for the Results data model
tekton-robot commented 7 months ago

@cmorinupgrade: The label(s) kind/docs cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/tektoncd/results/pull/708#issuecomment-1934265815): >/kind docs Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
tekton-robot commented 7 months ago

Hi @cmorinupgrade. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
AlanGreene commented 7 months ago

Hey @cmorinupgrade, is this related to an issue on the docs site? If so it might just be a matter of updating the mermaid version used on the website as the current syntax is working on GitHub: https://github.com/tektoncd/results?tab=readme-ov-file#data-model

image
AlanGreene commented 7 months ago

Title support was added in mermaid 9.3.0

feat: Title support via front matter for ER, state, class, git, and graph diagrams (https://github.com/mermaid-js/mermaid/pull/3706) @MasonM

cmorinupgrade commented 7 months ago

Title support was added in mermaid 9.3.0

feat: Title support via front matter for ER, state, class, git, and graph diagrams (mermaid-js/mermaid#3706) @MasonM

Good catch. Granted we could update the version! Repeating the title would still be duplication though. I would personally do both update the version and remove the repeated title. I removed it to match the same pattern we can see under Life of a Result section (we do not add the title again in the diagram).

I will leave it up to the reviewers to decide.

Thanks Alan

AlanGreene commented 7 months ago

Sounds good. I've also opened a PR to see if the updated version works on the website 🤞 https://github.com/tektoncd/website/pull/588

Edit: that seems to have done the trick

image
AlanGreene commented 7 months ago

/ok-to-test

tekton-robot commented 7 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/tektoncd/results/blob/main/OWNERS)~~ [adambkaplan] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
adambkaplan commented 7 months ago

/lgtm

avinal commented 7 months ago

Ah I was unable to respond in time: This issue is known and I had opened issue about it, closed due to inactivity: https://github.com/tektoncd/website/issues/544. As per last discussion, we are using a certain hugo theme in our tektoncd website. Last time I checked the theme hasn't updated the mermaid version. It seems to be updated now.