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

release: publish ui-bundle to let other projects reference it #537

Closed
wants to merge 1 commit into from

Conversation

nicolaferraro
Copy link
Member

I don't know if this will work with the new Apache policies (it works in my fork btw).

This will continuously release a moving snapshot tag based on the current master, with the ui-bundle.zip template as release artifact. This way I can set the following on a Camel subproject antora-playbook file:

# ...
ui:
  bundle:
    url: https://github.com/apache/camel-website/releases/download/snapshot/ui-bundle.zip

And that will render the subproject docs with the latest Apache Camel website template.

It's actually the same approach used by Antora for their default template (but they are on Gitlab).

Copy link
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

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

I love the idea

@github-actions
Copy link

🚀 Preview for c74dbfd is available at https://pr-537--camel.netlify.app

@djencks
Copy link
Contributor

djencks commented Feb 12, 2021 via email

@nicolaferraro
Copy link
Member Author

The new Antora based Asciidoctor docs site UI, at GitHub, has some tasks and actions to release a new version on each UI commit. That way you can be sure you know what you are getting. Dan has been saying for years the use of snapshots for the default UI is very ill-advised and finally did something about it for the Asciidoctor docs site. https://github.com/asciidoctor/asciidoctor-docs-ui.git https://github.com/asciidoctor/asciidoctor-docs-ui.git gulp.d/tasks/release.js .github/workflows/release.yml David Jencks

On Feb 11, 2021, at 2:22 PM, github-actions[bot] @.***> wrote: Preview for c74dbfd <c74dbfd> is available at https://pr-537--camel.netlify.app https://pr-537--camel.netlify.app/ — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELDXUUKXDMUKC5KQ75TLLS6RKBNANCNFSM4XPSSOYA.

Hi, are you suggesting we should start releasing tags of the website at each (or specific commits) and attach the UI to each release? That would complicate a bit the workflow in subprojects that need to align, but we can think to it if it's worth.

I can understand why Dan thinks that using snapshots for the default UI is a bad thing, an error there can break thousands of external projects that use it in "production". It's not exactly our context, where we want this only to have a preview of the subproject, because they don't live on their own.

Personally I'd use both approaches here, so I can use snapshot in the subprojects until it breaks. Wdyt?

@zregvart
Copy link
Member

I don't fully understand the need for this, we have one website we publish (camel.apache.org), and UI is built in the process of building that website. Is there another website that uses the same UI? If so I think this needs to be discussed on the dev mailing list first.

If this is for development, the build of the UI takes a couple of seconds and you can point to it on the filesystem. To speed up working on a component of the website I usually use a customized Antora playbook file containing only the scm configuration for that component. Then the workflow is quite easy and quick: (cd antora-ui-camel; yarn build) && yarn build:antora.

What we do not want is to have a release that's not under ASL published from a ASF repository, the UI is licensed under MPL 2.0.

@djencks
Copy link
Contributor

djencks commented Feb 12, 2021

I'm not sure we're understanding each other completely... probably my fault:-) I certainly don't see a point in putting a version on the website with each change, but it might make sense to put a version on the ui whenever it changes. If that's hard to detect currently I'd consider moving the ui to a dedicated repo.
So far this versioning scheme is only in use for for the asciidoctor docs website ui, which is only used for that site. No one has ported the code to gitlab... but since Apache is associated with GitHub it should be easy to copy the code.

@nicolaferraro
Copy link
Member Author

I don't fully understand the need for this, we have one website we publish (camel.apache.org), and UI is built in the process of building that website. Is there another website that uses the same UI? If so I think this needs to be discussed on the dev mailing list first.

You know what? It's Friday, not really a sunny day, but the weather is warm. I go for a walk.

If this is for development, the build of the UI takes a couple of seconds and you can point to it on the filesystem. To speed up working on a component of the website I usually use a customized Antora playbook file containing only the scm configuration for that component. Then the workflow is quite easy and quick: (cd antora-ui-camel; yarn build) && yarn build:antora.

What we do not want is to have a release that's not under ASL published from a ASF repository, the UI is licensed under MPL 2.0.

@oscerd oscerd reopened this Feb 12, 2021
@oscerd
Copy link
Contributor

oscerd commented Feb 12, 2021

I think there is value in this PR and the kamelet catalog needs to find a place in the website, so @zregvart if you have proposals on how to package this stuff and publish it it would be nice if you could share your thoughts. There is a lot of work behind this PR and the kamelet catalog one and lose it would be a shame.

@zregvart
Copy link
Member

@oscerd PR this publishes the result of building the antora-ui-camel, a Antora UI theme used only in building the camel.apache.org website, as a GitHub release. Changes needed to publish the Kamlet Catalog is in #536 and apache/camel-kamelets#2.

I did not object to this, I questioned the need for it, which I maintain is fair to question.

@oscerd
Copy link
Contributor

oscerd commented Feb 12, 2021

Yes, but in this way, maybe we won't have to build the whole website on each build? I think we should evaluate if it is worth to at least evaluate it

@oscerd
Copy link
Contributor

oscerd commented Feb 12, 2021

Maybe i misunderstood the problem but I think this was related in some way to kamelet catalog, to have a faster build

@github-actions
Copy link

🚀 Preview for c74dbfd is available at https://pr-537--camel.netlify.app

@zregvart
Copy link
Member

It takes 19s to build the antora-camel-ui (look for [14:30:59] Finished 'bundle' after 19 s) in the last build. Compared to the build of the whole website that's around 38min at the moment this is not an area we should be optimizing.

I think I understand the intention of this, but I don't see the need for this. For development (running previews and such), building the theme locally and using a custom Antora playbook gives much faster turnaround. For this to be of any use for previewing one would have to wait for the PR to be merged and the release to be made. So in that regard for preview/development this is not really helpful.

If the antora-camel-ui were to be used to publish a different website than camel.apache.org, this is another discussion, and one that needs to be done on the dev mailing list at that.

@oscerd
Copy link
Contributor

oscerd commented Feb 12, 2021

I don't think someone wants to use it outside of the Apache organization. By the way I'll wait @nicolaferraro for better understanding.

@nicolaferraro
Copy link
Member Author

I'm back. I know that a problem, and this in particular, can be solved in multiple ways. I was just proposing one.

This PR does something like publishing the snapshots of the website template on a repository, so that others can just pull it. We use this approach for Camel K and Camel K Runtime, using the official Apache Snapshots Maven repository. The advantage is that you can work on one project without having to link, build and periodically refresh the other and, at the same time, you find quickly if something breaks. It has also many drawbacks, I agree.

It's not a problem if this is not merged for the reasons above, it's not essential..

@zregvart
Copy link
Member

I think overall the only authoritative preview will be the one done on the camel-website repository, no other preview will be up to date or as involved as the one in the camel-website repository. If building the antora-camel-ui or using a custom Antora playbook was an issue then I could reconsider this, but I don't see it as an issue. On the other hand I see a number of issues if we do releases of antora-camel-ui, spanning from that UI being only a part of the overall Antora configuration (we have patches, extensions and attributes), specific Antora version. All that would need to be duplicated for the preview to be relevant. I would also maintain that the policy on releasing to GitHub releases is not in place or has been discussed, there is an area for confusion here, whereby someone might mistake this for an official ASF release, which for licensing reason and project charter reasons (not really a part of Camel distribution), I maintain, cannot be done.

So instead of doing this, I suggest working from the camel-website repository, copy the antora-playbook.yml, for faster tunraround remove all but needed content sources, point to local repositories as needed, and work with the yarn preview support we have here. That way any changes that would need to go into the antora-ui-camel can be previewed locally. This is how I work and the turnaround is ~15-20 sec at the most. We can certainly improve this workflow, i.e. preview could also auto-rebuild the antora-ui-camel, look for (say) custom-antora-playbook.yml and use that instead, watch the local content source repositories and rebuild on changes there and such, but this hasn't been on the top of my list as invoking (cd antora-ui-camel; yarn build) && yarn build:antora (for a subset of content sources), gives me really quick turnaround.

@djencks
Copy link
Contributor

djencks commented Feb 12, 2021

I have decidedly mixed feelings about this. My original point was simply that if the UI is made available to builds separate from the website build, it’s worth considering the latest way to do it, which happens to only work on GitHub at this point, rather than using the really problematical way the Antora default UI is “distributed” as an unstable snapshot.

Some points in favor of a versioned UI, independent of the website playbook project or content repos:

  • It allows going back to a "known good state" of the UI to build the production website or comparing UI versions without dealing with git branches or rollbacks.
  • Each content repo could have a "local playbook" that builds that source, using whatever UI version is desired.
  • Better separation of concerns (although this is questionable, since not all the site is built by Antora)

Against:

  • Involves some "legal" questions, although I'm confident they could be resolved to allow this in some way.
  • Might be more complicated.
  • (AFAIK) puts the Antora UI in a different repo than the non-Antora UI, or at least puts it on a different timeline.

@zregvart
Copy link
Member

I feel like we're debating what can be done and how and various pros/cons of each approach, but not focusing on why we should be doing it. The workflow and the amount of effort involved in getting a preview in another repository is equal or greater in effort and complexity than getting the preview running from this repository. With time the configuration, versions and any modifications done to how we use Antora will diverge.

Disregarding everything else (legal issues, added complexity, decay of configuration), what benefit does running a preview from another repository give us in contrast to running a preview from this repository?

@djencks
Copy link
Contributor

djencks commented Feb 15, 2021 via email

@djencks
Copy link
Contributor

djencks commented Oct 26, 2021

I saw this again today...

I think the problem this is trying to solve is to have really quick builds of small parts of the Antora website with the actual Camel UI bundle.

  • would it be very inconvenient to run such a "partial build" from a checkout of camel-website, presumably next to the e.g. camel-kamelets project that needs the preview?

After trying to fix a bunch of partial website builds eg. in camel-quarkus I'm convinced that the only sustainable approach involves generating small modifications of the antora-playbook.yml in camel-website. It's just not possible to keep anything else working. If we can agree on this then we can start to figure out how to do partial builds, and we won't need to have the UI available anywhere else. I have several ideas on how to automate partial builds, I'll see if I can come up with a somewhat concrete description.

@davsclaus
Copy link
Contributor

closing old outdated PRs

@davsclaus davsclaus closed this May 3, 2023
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

5 participants