-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add KUBECON.md #349
Add KUBECON.md #349
Conversation
Verified all the links in the new file work, except for this one: (the file does not exist until we merge this PR) |
This will not build successfully before fluxcd/community#349 gets merged (I will rebase to trigger the build again, so we can see it working) Signed-off-by: Kingdon P Barrett <[email protected]>
It can be in a separate PR, or we can hold this one up and put it in the same PR, but the idea is this We'll use this: to trigger the fluxcd/website netlify deploy job. I think there is no third step, unless we decide that we want to add a workflow that we can update the GitHub Sites page and it filters down to this repo, then you can merge changes direct to the website just by clicking the "publish" button and you can skip the PR reviews, like you mentioned in case of some last-minute change that needs to go in immediately. I had a look into Google Sites API, which was deprecated with the revamp in 2016. It appears to be surprisingly difficult to integrate externally with a Google Sites page now, unless you have "Sites Classic" So setting up triggers on Google Sites publish "Receiver-style" that trigger GitHub Actions jobs might be tricky, or even impossible. But we can fetch it every 10 minutes and write a trivial diff-based function that will make that work, even if it has 10 minutes delay, at least nobody would be waiting for a PR review to publish something urgently. I think it's compatible with these ideas, even if we want the Google Sites page to be the main target for our QR codes, we should not leave those details off the main Flux website. It's better if it's streamlined, I think the same content can be mirrored in both places and nobody will object. |
I had some time to think over how that workflow will work, and how we can expand this. We can add additional pages and scrape them in from a source, like Google Sites, and add them as additional pages under "KubeCon!" like the "Project" header that does not have a direct link target, and is only a parent in the navbar/menu entries. I don't know how we can make this bi-directional. If someone is editing the content in a Google Sites page, and we are scraping it into this repo, then people cannot edit the content in Git. Unless we use some kind of pull-request flow. There is no way I can think of to get content from Git into Google Sites, unless we can POST an html / markdown content into it directly. I don't think Sites supports this kind of automation, but we can do the reverse with a GitHub Actions scheduled job and simple Ruby script. That stuff is "Phase 2" and would be in a separate, follow-on set of PRs. |
To enable us to look at the preview, with a placeholder page. I have updated the "KubeCon!" navbar so it links to PROJECT-MEMBERS.md, as an external source. When we merge KUBECON.md in fluxcd/community#349 we can revert this commit or rebase it out. We may edit the structure further before all that happens, in previous years we had multiple tabs on the Google Sites page and we might want to replicate that as the "Project🔽" dropdown style - for now I have only made one page, because there aren't as many Flux talks as previous years that I'm aware of. Signed-off-by: Kingdon P Barrett <[email protected]>
TODO:
|
As we said we can iterate on this, I think we will see in the preview once it's incorporated into the main site, the image links do render. I just did a simple conversion of HTML to markdown and deleted a bunch of garbage that I don't think we need. We can work out any formatting issues before merging: which will do the actual publish step. |
We might need to fix some links so they do not refer back to the Google Sites page, mainly image references I mean I think those will necessarily be PRs to fluxcd/website, so we can add the static image content there. We can combine that with fluxcd/website#1804 - I'll leave the image references intact here, we will work it out in the next PR so there is no hot-linking or cross site anything. |
This will not build successfully before fluxcd/community#349 gets merged (I will rebase to trigger the build again, so we can see it working) Signed-off-by: Kingdon P Barrett <[email protected]>
To enable us to look at the preview, with a placeholder page. I have updated the "KubeCon!" navbar so it links to PROJECT-MEMBERS.md, as an external source. When we merge KUBECON.md in fluxcd/community#349 we can revert this commit or rebase it out. We may edit the structure further before all that happens, in previous years we had multiple tabs on the Google Sites page and we might want to replicate that as the "Project🔽" dropdown style - for now I have only made one page, because there aren't as many Flux talks as previous years that I'm aware of. Signed-off-by: Kingdon P Barrett <[email protected]>
I found # download from: - and parse into markdown, discarding the first 6 and last 13 lines:
wget https://sites.google.com/view/flux-kubecon-paris-2024/home -O kubecon.html \
&& html2md -i kubecon.html |sed '1,6d'|ghead -n -13 \
> KUBECON.md \
&& rm kubecon.html
# ... the content of KUBECON.md is added to a pull request This is the code that we will run in the workflow, I'm building a GHA file now that will let us use There is a branch now in the community repo, It only takes 2 minutes to hand craft one of these files, and we're probably going to merge from it 5 times at most, so I don't want to spend too much time on scripting... Happily, someone has already written html2md in go and it looks nearly suitable 🎉 |
I did some testing of the workflow here: (this is an example of the pull request that will be opened when the workflow completes) The workflow itself is here: I updated this so we're not building any go, just using a release archive of html2md (that's very fast)
|
I think we can merge it all at once now. The rest of the work will be able to be done on Google Sites, and in fluxcd/website#1804 |
Images are going to be a problem. As is the formatting around images. I can update the site references to use hard links so they are not 403, but we're going to have to invent some kind of system to classify them if we want them properly displayed. I'm for adding css classes in the alt text which seems likely to be a good solution. I can't see anything likely to go wrong. |
These will be incorporated into the page here: https://sites.google.com/view/flux-kubecon-paris-2024/home once they are published, (so we can scrape the content and not wind up with links to Google Sites, that prohibits hot-linking images) Related: * fluxcd/community#349 Signed-off-by: Kingdon Barrett <[email protected]>
These will be incorporated into the page here: https://sites.google.com/view/flux-kubecon-paris-2024/home once they are published, (so we can scrape the content and not wind up with links to Google Sites, that prohibits hot-linking images) Related: * fluxcd/community#349 Signed-off-by: Kingdon Barrett <[email protected]> (cherry picked from commit 56c90b1)
This is associated with fluxcd/website#1804 It will not be published on the website before we merge fluxcd/website#1804 We can see that it works in the preview build, (but we will need to merge this one first before we can see it working in the preview.) I don't see why we would publish this page any earlier than ~1-2 weeks before KubeCon at earliest. But there may be no reason to hold it up, either! update KUBECON.md to match scraped with minor edits via: https://sites.google.com/view/flux-kubecon-paris-2024/home https://codebeautify.org/html-to-markdown remove weird pointless whitespace links Formatting differences from wget https://sites.google.com/view/flux-kubecon-paris-2024/home -O kubecon.html && html2md -i kubecon.html |sed '1,6d'|ghead -n -13 > KUBECON.md && rm kubecon.html Add "Update Kubecon.md" workflow * fixup: kingdonb * add contents: write, pull-requests: write do not pass GITHUB_TOKEN explicitly (it is the default value) * permissions: contents, pull-requests * don't try building go inline in the action there is a release binary we can download and use, it's faster improve filter (remove Copy heading link) effect of script update Make this script easier to test Signed-off-by: Kingdon P Barrett <[email protected]> Signed-off-by: Kingdon B <[email protected]>
34fd275
to
0dea274
Compare
This script was super annoying to test as a GitHub Action, so I broke it out into I added a DEBUG flag which you can set to avoid doing the setup for html2md, in case you run this script locally and already ran go install for html2md: export DEBUG=1
./script/update-kubecon.sh The script also can't be tested on macos without additional changes because sed is not gsed I think what we'll do is take each of the three image slug placeholders I've added with this script, and turn them into shortcodes instead. Then we can invoke whatever html we want from the hugo templates, by calling into them with alt tags. |
I'm going to work out the last few details related to shortcodes in the other repo then I'll come back here and mark this one ready for review. The script output looks satisfactory IMO, but we're going to have to do some link munging because Google Sites will not hot-link to my external URL even if I give it one. It keeps copying the image into the site instead. So we just have to handle images a little bit carefully; I don't think it's a blocker but it might prove to be too much trouble. We have to merge this soon though, as the URL is being used in a QR code at KubeCon. |
I believe I figured out how to use shortcodes properly(ish) - I'm comfortable merging this now, I don't think the script will need more changes, unless we're adding more images. The only thing that's going to need work now is the website repo - I've placed a CSS class on each image/figure reference, we should be able to see them in the site preview after this is merged. It's going to need a little bit of tweaking to make the CSS class do something, then we can merge fluxcd/website#1804 and make it live. |
https://github.com/kingdonb/community/actions/runs/8068067412/job/22039967712 * Update KUBECON.md * break out update-kubecon into script * Strip image links to replace with shortcodes Add a debug flag and test the script several more times * try figure shortcode (x2) * update KUBECON.md from script Signed-off-by: Kingdon Barrett <[email protected]> Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
The only thing I'm not sure about:
I didn't think there was any reason to escape these dashes, but html2md may know better. I have tested the script a bunch of times, including in github actions workflow (at kingdonb/community), and I don't think it will break. 🤞 |
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.
Need one approving review to merge this, @stefanprodan @mewzherder FYI
LGTM
Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
This is associated with fluxcd/website#1804
It will not be published on the website before we merge fluxcd/website#1804
We can see that it works in the preview build, (but we will need to merge this one first before we can see it working in the preview.)
I don't see why we would publish this page any earlier than ~1-2 weeks before KubeCon at earliest.
But there may be no reason to hold it up, either!