32
41
Fork
You've already forked website
53

use git submodules for documentation content #331

Merged
caesar merged 3 commits from caesar/forgejo-website:docs-submodules into main 2023年08月16日 11:05:58 +02:00
Member
Copy link

I like the idea of fully separating the documentation content from the website code, as proposed in #154.

Here's one way it could be done, using git submodules. I've used branches in the docs repo (currently https://codeberg.org/caesar/forgejo-docs/) for the different versions. I think this could be more maintainable than side-by-side directories.

However I'm not totally sure about the Git submodule approach as it requires the commit SHAs of the submodules to be committed to the parent repo, so updating the docs will still require committing to the website repo.

One way to avoid that might be to use a script to pull from the docs repo before build, instead of actually using Git submodules.
Perhaps someone with more experience with Git submodules has a better idea.

I should note that this is very much an experiment and I'm not totally committed to the idea. I can also see an advantage of keeping both code and content in the same repo, in cases where changes to the code might require updates to the documentation content.

Closes #154

Preview https://forgejo.codeberg.page/@pull_331/

I like the idea of fully separating the documentation content from the website code, as proposed in #154. Here's one way it could be done, using git submodules. I've used branches in the docs repo (currently https://codeberg.org/caesar/forgejo-docs/) for the different versions. I think this could be more maintainable than side-by-side directories. However I'm not totally sure about the Git submodule approach as it requires the commit SHAs of the submodules to be committed to the parent repo, so updating the docs will still require committing to the `website` repo. One way to avoid that might be to use a script to pull from the `docs` repo before build, instead of actually using Git submodules. Perhaps someone with more experience with Git submodules has a better idea. I should note that this is very much an experiment and I'm not totally committed to the idea. I can also see an advantage of keeping both code and content in the same repo, in cases where changes to the code might require updates to the documentation content. Closes #154 Preview https://forgejo.codeberg.page/@pull_331/
Author
Member
Copy link

The CI is giving a strange error: Host key verification failed when cloning the submodules. No idea why...

The CI is giving a strange error: `Host key verification failed` when cloning the submodules. No idea why...
Contributor
Copy link

I like that the docs are in a single place at the moment as it allows me to focus on content. I see them as a temporary place where information can be collected and written in a way that is helpful to people. I link to the documentation when answering questions in the chat. I also update the documentation when I need to answer a question that has no answer in the documentation. Finally I use the documentation as a way to remember how things work when they get too complicated, such as Forgejo Actions.

Having the docs neatly separated in a content section where I do not have to worry about how it is presented is a welcome improvement. And I think it will help move the documentation to a proper framework with all the bells and whistles the reader expects when navigating them.

Restructuring them into multiple repositories is less appealing to me because it adds structure. This will be more effort for me when updating. Although I see some benefits in the proposed separation it feels like it could get in the way when moving to a documentation framework.

I like that the docs are in a single place at the moment as it allows me to focus on content. I see them as a temporary place where information can be collected and written in a way that is helpful to people. I link to the documentation when answering questions in the chat. I also update the documentation when I need to answer a question that has no answer in the documentation. Finally I use the documentation as a way to remember how things work when they get too complicated, such as Forgejo Actions. Having the docs neatly separated in a content section where I do not have to worry about how it is presented is a welcome improvement. And I think it will help move the documentation to a proper framework with all the bells and whistles the reader expects when navigating them. Restructuring them into multiple repositories is less appealing to me because it adds structure. This will be more effort for me when updating. Although I see some benefits in the proposed separation it feels like it could get in the way when moving to a documentation framework.
Contributor
Copy link

The CI failure is because .gitmodules uses ssh url. You should use https urls that do not rely on ssh instead.

[submodule "docs-v1.19"]
	path = src/content/docs/v1.19
	url = git@codeberg.org:caesar/forgejo-docs.git
	branch = v1.19
[submodule "docs-v1.20"]
	path = src/content/docs/v1.20
	url = git@codeberg.org:caesar/forgejo-docs.git
	branch = v1.20

https://woodpecker-ci.org/docs/next/usage/pipeline-syntax#git-submodules

The CI failure is because .gitmodules uses ssh url. You should use https urls that do not rely on ssh instead. ``` [submodule "docs-v1.19"] path = src/content/docs/v1.19 url = git@codeberg.org:caesar/forgejo-docs.git branch = v1.19 [submodule "docs-v1.20"] path = src/content/docs/v1.20 url = git@codeberg.org:caesar/forgejo-docs.git branch = v1.20 ``` https://woodpecker-ci.org/docs/next/usage/pipeline-syntax#git-submodules
caesar force-pushed docs-submodules from 9947c66af7
Some checks failed
forgejo-ci/pr/woodpecker Pipeline failed
to 0dc7fe6d00
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
2023年08月06日 11:19:07 +02:00
Compare
Collaborator
Copy link
Preview ready: https://forgejo.codeberg.page/@pull_331/
Author
Member
Copy link

A better presentation for the docs – either by moving to a dedicated framework or by implementing features directly – is a goal of mine (I'll open an issue later to discuss strategy).
I don't think this change of moving the docs content out of the website source repo will make a big difference either way to that. It is mostly just an organizational change that makes sense to me, especially to separate the issue trackers.
That said, now that the website repo history and issue tracker are already full of docs commits, maybe it's too late to sensibly and easily make this change.

To be honest, what I would prefer to see long term is for the docs content to live in the Forgejo source tree (as Gitea's docs do). I'd like the process to be more structured so that any time code changes are made that need documenting, the docs would be simultaneously updated.
However, I can see that this would be a challenge with the soft fork workflow, so I'm not particularly optimistic about it being implemented in the near future.

In the meantime I have no objection to just continuing as we are. This PR is more of a way to play with the idea proposed in #154 than something I actually want to see implemented right now.

A better presentation for the docs – either by moving to a dedicated framework or by implementing features directly – is a goal of mine (I'll open an issue later to discuss strategy). I don't think this change of moving the docs content out of the website source repo will make a big difference either way to that. It is mostly just an organizational change that makes sense to me, especially to separate the issue trackers. That said, now that the website repo history and issue tracker are already full of docs commits, maybe it's too late to sensibly and easily make this change. To be honest, what I would prefer to see long term is for the docs content to live in the Forgejo source tree (as Gitea's docs do). I'd like the process to be more structured so that any time code changes are made that need documenting, the docs would be simultaneously updated. However, I can see that this would be a challenge with the soft fork workflow, so I'm not particularly optimistic about it being implemented in the near future. In the meantime I have no objection to just continuing as we are. This PR is more of a way to play with the idea proposed in #154 than something I actually want to see implemented right now.
Contributor
Copy link

That said, now that the website repo history and issue tracker are already full of docs commits, maybe it's too late to sensibly and easily make this change.

It is trivial to create a repository with just the commits that are related to the docs repository. I don't remember the name of the git extension that does this right now but it is a oneliner.

To be honest, what I would prefer to see long term is for the docs content to live in the Forgejo source tree (as Gitea's docs do). I'd like the process to be more structured so that any time code changes are made that need documenting, the docs would be simultaneously updated.
However, I can see that this would be a challenge with the soft fork workflow, so I'm not particularly optimistic about it being implemented in the near future.

Ideally yes. But the reality is that the dynamics of the documentation are entirely different than the code. In the vast majority of cases the person updating the documentation is not the person who implemented the feature / bug fix.

In the meantime I have no objection to just continuing as we are. This PR is more of a way to play with the idea proposed in #154 than something I actually want to see implemented right now.

I stated my reservations but I'm fine with the extra effort of having a separate repository if you feel this gives you more flexibility to improve the presentation.

> That said, now that the website repo history and issue tracker are already full of docs commits, maybe it's too late to sensibly and easily make this change. It is trivial to create a repository with just the commits that are related to the docs repository. I don't remember the name of the git extension that does this right now but it is a oneliner. > To be honest, what I would prefer to see long term is for the docs content to live in the Forgejo source tree (as Gitea's docs do). I'd like the process to be more structured so that any time code changes are made that need documenting, the docs would be simultaneously updated. > However, I can see that this would be a challenge with the soft fork workflow, so I'm not particularly optimistic about it being implemented in the near future. Ideally yes. But the reality is that the dynamics of the documentation are entirely different than the code. In the vast majority of cases the person updating the documentation is not the person who implemented the feature / bug fix. > In the meantime I have no objection to just continuing as we are. This PR is more of a way to play with the idea proposed in #154 than something I actually want to see implemented right now. I stated my reservations but I'm fine with the extra effort of having a separate repository if you feel this gives you more flexibility to improve the presentation.
Ghost approved these changes 2023年08月06日 16:47:59 +02:00
Ghost left a comment
Copy link

I can see how having a separate repository would help with experimenting so 👍

I can see how having a separate repository would help with experimenting so 👍
crystal left a comment
Copy link

I think this implementation is preferable to the way we're doing it now. We can set up a bot to update the submodule. We can also change the way it's implemented in the future. In any case I think having the docs in a different repo is a step in the right direction.

It is trivial to create a repository with just the commits that are related to the docs repository. I don't remember the name of the git extension that does this right now but it is a oneliner.

We should do this.

I think this implementation is preferable to the way we're doing it now. We can set up a bot to update the submodule. We can also change the way it's implemented in the future. In any case I think having the docs in a different repo is a step in the right direction. > It is trivial to create a repository with just the commits that are related to the docs repository. I don't remember the name of the git extension that does this right now but it is a oneliner. We should do this.
Author
Member
Copy link

Cross-posted from Matrix for visibility / archival:

I'm trying to decide on the ideal structure for the new docs repo (to contain only the content and be pulled into the website with Git submodules).

I'm using git-filter-repo to rewrite history and keep only the commits that affected the docs content.

I'd appreciate some input on the structure of the new repo. I'm thinking of doing what I already did in that PR: creating a separate branch for each version of the docs (v1.19, v1.20, v1.21 – maybe also latest and next could be branches that simply track the same head as the relevant version branches). One big advantage I see here is ease of backporting docs fixes to older versions by simply cherry-picking or even merging the same fix to both branches, git-flow-style.

But before I (ahem) commit to that structure, I'd appreciate input if anyone sees any major downsides or would prefer a different structure such as keeping all the versions in different directories on the same branch.

Cross-posted [from Matrix](https://matrix.to/#/!zpNKWqkiEOyljSMQDK:matrix.org/$jUMzTY3jW9fkoMWP5xGYBoS7siZch7r_zVOcZVVyuHQ) for visibility / archival: > I'm trying to decide on the ideal structure for the new `docs` repo (to contain only the content and be pulled into the website with Git submodules). > > I'm using [git-filter-repo](https://github.com/newren/git-filter-repo) to rewrite history and keep only the commits that affected the docs content. > > I'd appreciate some input on the structure of the new repo. I'm thinking of doing what I already did in that PR: creating a separate branch for each version of the docs (`v1.19`, `v1.20`, `v1.21` – maybe also `latest` and `next` could be branches that simply track the same head as the relevant version branches). One big advantage I see here is ease of backporting docs fixes to older versions by simply cherry-picking or even merging the same fix to both branches, `git-flow`-style. > > But before I (ahem) _commit_ to that structure, I'd appreciate input if anyone sees any major downsides or would prefer a different structure such as keeping all the versions in different directories on the same branch.
caesar force-pushed docs-submodules from 0dc7fe6d00
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
to 9c6528f3ef
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
2023年08月12日 13:33:21 +02:00
Compare

@earl-warren @Gusted since we've been the most active on the documentation lately, I propose to pause contributions for a few days so @caesar can work on the submodule separation without too much catching up with changes. It could be starting today or whenever @caesar says go.

@earl-warren @Gusted since we've been the most active on the documentation lately, I propose to pause contributions for a few days so @caesar can work on the submodule separation without too much catching up with changes. It could be starting today or whenever @caesar says go.
Author
Member
Copy link

Thanks @dachary, I was considering suggesting the same to reduce conflicts. I've already forked the docs so any changes from now I'll need to merge manually.

PRs could still be opened (ideally making changes to just one version of the docs) but just not merged, and I'll cherry-pick the changes.

I'll try and get this done today or tomorrow so as not to create too much of a backlog.

Thanks @dachary, I was considering suggesting the same to reduce conflicts. I've already forked the docs so any changes from now I'll need to merge manually. PRs could still be opened (ideally making changes to just one version of the docs) but just not merged, and I'll cherry-pick the changes. I'll try and get this done today or tomorrow so as not to create too much of a backlog.
Contributor
Copy link

I'm fine refraining from documenting for a week.

I'm fine refraining from documenting for a week.

Same here.

Same here.
caesar force-pushed docs-submodules from 45db4adf34
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
to 5e04dbc063
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
2023年08月13日 02:09:48 +02:00
Compare
.woodpecker.yml Outdated
@ -17,6 +17,7 @@ pipeline:
image:node:19
pull:true
commands:|
git submodule update --remote
Owner
Copy link

I'm not sure about this, it maybe preferable to implement some method of updating the recorded SHA-1 for the submodule.

I'm not sure about this, it maybe preferable to implement some method of updating the recorded SHA-1 for the submodule.
Author
Member
Copy link

What would be the advantage of that over simply fetching the latest version of each docs branch on every build, as this does? If the SHAs were updated automatically on every commit to the docs repo, I don't see a practical difference beyond massively cluttering the website repo history.
Additionally, it would require the action that runs to update it when the docs are committed to to have full commit access to the website repo, which seems dangerous – though maybe this can be mitigated with careful thought?

What would be the advantage of that over simply fetching the latest version of each docs branch on every build, as this does? If the SHAs were updated automatically on every commit to the docs repo, I don't see a practical difference beyond massively cluttering the website repo history. Additionally, it would require the action that runs to update it when the docs are committed to to have full commit access to the website repo, which seems dangerous – though maybe this can be mitigated with careful thought?
Owner
Copy link

I suppose that's true. I think there are a few things we can do to mitigate the risks of this approach, but it would clutter the website repo's commit history, especially if we want to make changes to the docs and have them deployed to the website right away. I was thinking it would be nice if we could easily tell which specific revision of the docs repo the website was built against at any given time, but there are other ways of doing this, such as inserting the commit hash of each submodule into one of the generated HTML files during compilation.

We should also consider how to automate tests, previews, and rebuilds. Ideally, the docs pipeline should simulate the website pipeline and use it to generate a preview like the ones we already have here. The website repo also needs to be rebuilt without a commit being added whenever one of the next/release branches are updated.

I suppose that's true. I think there are a few things we can do to mitigate the risks of this approach, but it would clutter the website repo's commit history, especially if we want to make changes to the docs and have them deployed to the website right away. I was thinking it would be nice if we could easily tell which specific revision of the docs repo the website was built against at any given time, but there are other ways of doing this, such as inserting the commit hash of each submodule into one of the generated HTML files during compilation. We should also consider how to automate tests, previews, and rebuilds. Ideally, the docs pipeline should simulate the website pipeline and use it to generate a preview like the ones we already have here. The website repo also needs to be rebuilt without a commit being added whenever one of the next/release branches are updated.
Author
Member
Copy link

if we want to make changes to the docs and have them deployed to the website right away

I think that is probably desirable, at least most of the time.

inserting the commit hash of each submodule into one of the generated HTML files during compilation

That's a good idea, I'll look into doing that.

We should also consider how to automate tests, previews, and rebuilds. Ideally, the docs pipeline should simulate the website pipeline and use it to generate a preview like the ones we already have here. The website repo also needs to be rebuilt without a commit being added whenever one of the next/release branches are updated.

I'm less than proficient with the devops side of things, so I'd appreciate any suggestions on the best way to go about this. I'd been thinking we'd use a webhook on the docs repo to trigger the website pipeline, but even if it's mostly the same, at least the comment with the preview links will have to be on the docs repo for previews of docs changes.

Would this be a good time to switch from Woodpecker to Forgejo Actions / what would be the pros and cons?

> if we want to make changes to the docs and have them deployed to the website right away I think that is probably desirable, at least most of the time. > inserting the commit hash of each submodule into one of the generated HTML files during compilation That's a good idea, I'll look into doing that. > We should also consider how to automate tests, previews, and rebuilds. Ideally, the docs pipeline should simulate the website pipeline and use it to generate a preview like the ones we already have here. The website repo also needs to be rebuilt without a commit being added whenever one of the next/release branches are updated. I'm less than proficient with the devops side of things, so I'd appreciate any suggestions on the best way to go about this. I'd been thinking we'd use a webhook on the docs repo to trigger the website pipeline, but even if it's mostly the same, at least the comment with the preview links will have to be on the docs repo for previews of docs changes. Would this be a good time to switch from Woodpecker to Forgejo Actions / what would be the pros and cons?
Author
Member
Copy link

I'd appreciate any feedback on the docs repo structure at caesar/forgejo-docs#1 if anyone has any suggestions.

I'd appreciate any feedback on the docs repo structure at https://codeberg.org/caesar/forgejo-docs/issues/1 if anyone has any suggestions.
caesar force-pushed docs-submodules from 5e04dbc063
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
to cbffc8e225
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
2023年08月15日 01:37:28 +02:00
Compare
Author
Member
Copy link

@earl-warren @Gusted since we've been the most active on the documentation lately, I propose to pause contributions for a few days so @caesar can work on the submodule separation without too much catching up with changes. It could be starting today or whenever @caesar says go.

I think forgejo/docs is ready for PRs to be opened there if there is documentation work to be done.

> @earl-warren @Gusted since we've been the most active on the documentation lately, I propose to pause contributions for a few days so @caesar can work on the submodule separation without too much catching up with changes. It could be starting today or whenever @caesar says go. I think [forgejo/docs](https://codeberg.org/forgejo/docs) is ready for PRs to be opened there if there is documentation work to be done.
caesar force-pushed docs-submodules from cbffc8e225
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
to 0fffb280c4
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
2023年08月15日 17:08:02 +02:00
Compare
Author
Member
Copy link

I think the only thing left to do before merging this is to sort out the CI (forgejo/docs#3).
If anyone has any suggestions let me know, otherwise I'll take a stab at it this evening hopefully.

I think the only thing left to do before merging this is to sort out the CI (forgejo/docs#3). If anyone has any suggestions let me know, otherwise I'll take a stab at it this evening hopefully.

The URL to the submodule should be updated (to https://codeberg.org/forgejo/docs) before this is merged. Other than that, this is fine to merge now. Since contributions to the docs are frozen right now anyway, I don't think it would hurt to implement the CI stuff shortly after merging this. I will try to find some time to help out with this later today.

The URL to the submodule should be updated (to https://codeberg.org/forgejo/docs) before this is merged. Other than that, this is fine to merge now. Since contributions to the docs are frozen right now anyway, I don't think it would hurt to implement the CI stuff shortly after merging this. I will try to find some time to help out with this later today.
Author
Member
Copy link

The URL to the submodule should be updated

Thanks for the reminder!

> The URL to the submodule should be updated Thanks for the reminder!
caesar force-pushed docs-submodules from 97f0dd9273
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
to 4e602fb3e9
All checks were successful
forgejo-ci/pr/woodpecker Pipeline was successful
2023年08月16日 11:04:09 +02:00
Compare
caesar changed title from (削除) WIP: use git submodules for documentation content (削除ここまで) to use git submodules for documentation content 2023年08月16日 11:04:20 +02:00
caesar deleted branch docs-submodules 2023年08月16日 11:06:01 +02:00
Sign in to join this conversation.
Labels
Clear labels
404
Broken links or missing content
Accessibility
Accessibility
Blog post
Documentation
Forgejo Documentation
Internationalisation
i18n and l10n
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/website!331
Reference in a new issue
forgejo/website
No description provided.
Delete branch "caesar/forgejo-website:docs-submodules"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?