-
Notifications
You must be signed in to change notification settings - Fork 486
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
sync docs on tags #1515
sync docs on tags #1515
Conversation
This is great! One question comes to mind: how does this handle non-stable releases or untraditional release orders? There are two scenarios that I can think of here:
|
Hi I am exploring similar automation for Tempo and have ran into the same questions and here is how I am planning to address them. I have a barebones github action which converts a branch or tag name ("github_ref_name") into the target folder
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Hey folks! Sorry for not following through with this last week. I agree with Marty's thoughts on both points. We can use the fine-grained trigger to only trigger on specific tags and release branches to exempt release candidates, betas etc. Also, I agree it would be okay to re-sync the docs in cases of patch releases or new commits to release branches, so no manual ordering is needed. @mdisibio I have 0 knowledge about Typescript, so initially to get the same results as you, I used some simple bash, regex+capture groups to extract if [[ $input =~ ^v([0-9]+)\.([0-9]+)\.[0-9]+$ ]]; then
echo "v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
elif [[ $input =~ ^release-([0-9]+)\.([0-9]+)\.[0-9]+$ ]]; then
echo "v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
else
exit 1
fi I think we might be able to use this inline as a step in the GH action. Any preference on which of the two we should start experimenting with? |
Great to hear, I think we are homing in on a good solution. I had also started with some simple bash scripting, but found it cumbersome to pass output to the next step (also my bash was not as good as yours). I think the github action will be simpler overall when considering how many repos could make use of this and any other changes we'd like in the future, but I am interested to see a full bash workflow too if you are. Oh I also updated the typescript to use |
You're kinda right, I wouldn't want to push the burden of adding hard-to-read commands on every project that wants to use it. I'll toy around with the bash workflow on a branch of my own and ping you, but we can start by using your solution here. |
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@mdisibio @robbymilo I took the liberty of separating the workflow in two Github Actions
I'll test some more in my own fork, but it seems to be a good start. EDIT: What do y'all think? ^^ |
Since the typescript snippet handles |
@mdisibio Still not sure what the |
@tpaschalis Yep by checking the string-string map at the top.
The map |
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Alright, this seems to work 🎉 Pushing a new commit on main Pushing a new tag Pushing a new tag Pushing a commit on the branch Pushing a commit on the branch |
Below is me thinking out loud about the interaction of syncing on both release branches and on tags. I would love to know if my understanding matches with everyone here. I imagine we expect tags to be immutable and would represent an update to the docs expected only when a new patch release is made. For subsequent docs changes, we would expect them to be cherry-picked into the corresponding release branch. Patch releases for previous versions would be branched from the previous patch release. With those assumptions, I think this behaves as we want and ensures we never sync inconsistent documentation for released versions. |
@jdbaldry yes your assumptions sound about right! We'll probably take this for a test drive in our Agent release this week, we'd be happy if other projects were able to use it as well! |
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to determine how we intend to update documentation for versioned releases. I would suggest that we only sync documentation for a release when vX.Y.0 is tagged, but not any other patch release.
This means that documentation improvements can be immediately backported into a release by a PR to the docs folder.
If we leave this as-is, that means:
- You cannot manually backport changes to a release folder because it would get overwritten if we did a patch release
- You have to wait for a patch release to be created for updated release docs to get re-synced (if a patch release ever gets created at all)
- Backporting changes to multiple previous releases is more difficult, as you have to do it across one PR per release branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving some thoughts here but I may be missing some context that is specific to the Agent repo and workflow, so this is more from a Tempo point of view.
The tags and branch filters can independently trigger, so I think the workflow will handle the cases mentioned.
You cannot manually backport changes to a release folder because it would get overwritten if we did a patch release
It's expected to build the next patch off of the existing release branch, and any docs updates would have already been committed there. Could you give an example of what might get overwritten?
You have to wait for a patch release to be created for updated release docs to get re-synced (if a patch release ever gets created at all)
A commit to the release branch should resync immediately, no tag or release needed.
Backporting changes to multiple previous releases is more difficult, as you have to do it across one PR per release branch
This is true and was not a design goal. I'm not familiar with this use case, or sure if it's common enough to address. Since the website documentation is forked into subfolders, I'm not sure what automation would look like to sync them all off of 1 PR. What did you have in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's expected to build the next patch off of the existing release branch, and any docs updates would have already been committed there. Could you give an example of what might get overwritten?
Right, I'm saying if copy changes are done to grafana/website so they appear immediately, and not synced to grafana/agent. The next patch release tag will re-sync the folder overriding any manual changes done.
- Release v0.100.0 gets cut,
v0.100
docs synced to grafana/website - Copy changes manually made to grafana/website/docs/agent/v0.100
- Release v0.100.1 gets cut,
v0.100
docs re-synced to grafana/website - Previous copy changes get lost because they were not made to grafana/agent
A commit to the release branch should resync immediately, no tag or release needed.
That should only be true after we cut a stable release, which won't be true for every release branch (unfortunately). We create a single release-X.Y branch to cover the entire X.Y.Z release "series," including release candidates.
This is true and was not a design goal. I'm not familiar with this use case, or sure if it's common enough to address. Since the website documentation is forked into subfolders, I'm not sure what automation would look like to sync them all off of 1 PR. What did you have in mind?
My understanding is that documentation writers will manually backport changes to grafana/website. With the current flow, they're able to backport to multiple previous versions at once (since it's one giant directory tree). If the source of truth becomes repositories, then it becomes slightly more tedious.
My understanding could be wrong, or it could also be that nobody would mind this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, we document our current release process here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy changes are done to grafana/website
Ok yes, agree with everything you've said under that scenario. My understanding is that kind of activity is rare, and will be moreso after this automation. We do want the upstream repositories to be the source of truth.
backport to multiple previous versions at once
Agree, that scenario would not be supported. I have not heard it mentioned so thinking it's a worthwhile tradeoff for the increased automation in general. Definitely for Tempo and GET.
single release-X.Y branch
We do the same. I think I understand part of your concern in that under this setup the documentation would get to the website "early", before the final stable candidate is pushed. However, the thoughts are that it's not a blocker for a few reasons: (1) the time between starting a release (creating the branch) and the stable .0 tag is relatively short (a few days) (2) we can devise a tweak to the workflow later if needed (already have some rough ideas).
won't be true for every release branch
Got it, for Tempo that is not an issue. I think we have a good base to build on here, but expect every project will have some customization. Syncing on both tags and branch commits is already quite heavy-handed and more just to start with a generic solution and experimentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that documentation writers will manually backport changes to grafana/website. With the current flow, they're able to backport to multiple previous versions at once (since it's one giant directory tree). If the source of truth becomes repositories, then it becomes slightly more tedious.
This isn't the preferred approach. The website should reflect the technical documentation stored in the product/project repo, with the website automatically reflecting that change. Thus, backporting should happen only in the product/project repo.
More detail: if we update the website, we have to make a duplicate PR in the respective product/project repo. Duplicate work is not only inefficient, but also prone to error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backporting is relatively common in some products, not as frequent in others. We'd like to enable a consistent approach. And our aim is to not backport more than two minor releases back, similar to the backporting policy for security fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, that scenario would not be supported. I have not heard it mentioned so thinking it's a worthwhile tradeoff for the increased automation in general. Definitely for Tempo and GET.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we've teased out some good issues here. @jdbaldry may also want to comment, as he's focused now on the docs build pipeline with the goal of creating more consistency and sharing practices.
Thank you for the dialog on this - I think it's definitely a step forward
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Waiting to merge this until we have reviewed Agent documentation |
This PR has been automatically marked as stale because it has not had any activity in the past 30 days. |
* fix test volume path, add tag trigger * update target folder * Separate to two Github Actions Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Re-combine the into one Action Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Rename so that Github picks up specific code changes Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Point to upstream grafana-github-actions repo after merge Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Point to upstream grafana-github-actions repo after merge 2 Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> Co-authored-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
* fix test volume path, add tag trigger * update target folder * Separate to two Github Actions Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Re-combine the into one Action Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Rename so that Github picks up specific code changes Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Point to upstream grafana-github-actions repo after merge Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> * Point to upstream grafana-github-actions repo after merge 2 Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> Co-authored-by: Paschalis Tsilias <paschalis.tsilias@grafana.com> Co-authored-by: Robby Milo <robbymilo@fastmail.com> Co-authored-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
PR Description
main
branchTodo:
main
branch tonext
dirNeeds https://github.com/grafana/website/pull/8124