Clone once #52

Merged
lunny merged 6 commits from jolheiser/gitea-docusaurus:clone-once into main 2023-07-28 05:52:36 +00:00
Owner

Closes #30
Closes #31
Closes #42

Rather than partially cloning, instead we clone once and then clean (to remove generated files), reset (to reset changed files), and checkout branches as needed. This should allow the outdated translation check to continue to work while also reducing build times significantly.

Before:
before

After:
after

Closes #30 Closes #31 Closes #42 Rather than partially cloning, instead we clone once and then `clean` (to remove generated files), `reset` (to reset changed files), and `checkout` branches as needed. This should allow the outdated translation check to continue to work while also reducing build times significantly. Before: ![before](/attachments/07c16ef5-110c-451a-9f1b-79f2c8b72caf) After: ![after](/attachments/d6251f63-087d-4270-946f-63148b8f642a)
jolheiser added 3 commits 2023-07-27 21:51:43 +00:00
feat: clone once and update theme
Signed-off-by: jolheiser <john.olheiser@gmail.com>
0196e99ae5
refactor: remove unneeded param from check_outdated
Signed-off-by: jolheiser <john.olheiser@gmail.com>
3e48e6fb85
chore: revert css change for other PR
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Some checks failed
checks / build-docs (pull_request) Failing after 14m18s
a82f3eb497
denyskon reviewed 2023-07-27 22:04:06 +00:00
denyskon left a comment
Member

Good Idea! I noticed a few things

Good Idea! I noticed a few things
@ -45,2 +48,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
bash loop_docs.sh latest zh-cn
rm -rf .tmp/upstream-docs-latest
# rm -rf .tmp/upstream-docs-latest
Member

Why not remove?

Why not remove?
Author
Owner

Removing would make it clone the next time, which would defeat the purpose of this PR. I can remove the line rather than comment, though.

It also means re-running the build commands doesn't require re-cloning, which makes local dev easier. The only caveat is that make clean is required in order to get "new" docs if there are commits to the upstream during dev. (or you could cd and manually pull it)

Removing would make it clone the next time, which would defeat the purpose of this PR. I can remove the line rather than comment, though. It also means re-running the build commands doesn't require re-cloning, which makes local dev easier. The only caveat is that `make clean` is required in order to get "new" docs if there are commits to the upstream during dev. (or you could `cd` and manually pull it)
Owner

I think @denyskon meant removing the commented-out code…

I think @denyskon meant removing the commented-out code…
Author
Owner

Oof, yeah that makes way more sense....
I can remove it! 😁

Oof, yeah that makes way more sense.... I can remove it! 😁
Member

I ment removing the line 😆 It is good not to remove the directory in between.

I ment removing the line 😆 It is good not to remove the directory in between.
jolheiser marked this conversation as resolved
Makefile Outdated
@ -71,2 +74,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md
bash loop_docs.sh $* zh-cn
rm -rf .tmp/upstream-docs-$*
#rm -rf .tmp/upstream-docs-$*
Member

As above

As above
@ -2,3 +2,2 @@
# The script takes two params:
# version: "latest" or a specific version number
# The script takes one param:
Member

The script takes locale as a param and checks if ....

`The script takes locale as a param and checks if ....`
jolheiser marked this conversation as resolved
delvh reviewed 2023-07-27 22:04:53 +00:00
@ -9,1 +9,4 @@
.PHONY: clone
clone: create_dir
git clone https://github.com/go-gitea/gitea.git .tmp/upstream-docs || true
Owner

Why always successful?

Why always successful?
Author
Owner

If the clone already exists git complains that it already exists and the command fails, however for local dev it's very helpful if the clone already exists rather than re-cloning.

If the clone already exists `git` complains that it already exists and the command fails, however for local dev it's very helpful if the clone already exists rather than re-cloning.
Owner

The problem I see with that: There can be arbitrary many reasons why the clone fails.
I'm more in favor of explicitly handling this one edge case than never failing.
I want to know if the clone fails for any other reason.

The problem I see with that: There can be arbitrary many reasons why the clone fails. I'm more in favor of explicitly handling this one edge case than never failing. I want to know if the clone fails for any other reason.
Author
Owner

You would still see if/why the clone fails, it prints all output still.

You would still see if/why the clone fails, it prints all output still.
Owner

Could we just clone the special branches here?

Could we just clone the special branches here?
delvh marked this conversation as resolved
@ -25,2 +28,3 @@
cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout main
cur_path=`pwd`
cd .tmp/upstream-docs-latest/docs && bash scripts/trans-copy.sh
cd .tmp/upstream-docs/docs && bash scripts/trans-copy.sh
Owner

How is that supposed to work?
You are never cding out?

How is that supposed to work? You are never `cd`ing out?
Author
Owner

Each line in a recipe is ran in a separate sub-shell.

Each line in a recipe is ran in a separate sub-shell.
delvh marked this conversation as resolved
@ -45,2 +48,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
bash loop_docs.sh latest zh-cn
rm -rf .tmp/upstream-docs-latest
# rm -rf .tmp/upstream-docs-latest
Owner

Commented out code?

Commented out code?
jolheiser marked this conversation as resolved
Makefile Outdated
@ -51,2 +54,3 @@
cd .tmp/upstream-docs && git clean -f && git reset --hard && git checkout release/v1.$*
cur_path=`pwd`
cd .tmp/upstream-docs-$*/docs && bash scripts/trans-copy.sh
cd .tmp/upstream-docs/docs && bash scripts/trans-copy.sh
Owner

Same as above?

Same as above?
delvh marked this conversation as resolved
Makefile Outdated
@ -71,2 +74,3 @@
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md
bash loop_docs.sh $* zh-cn
rm -rf .tmp/upstream-docs-$*
#rm -rf .tmp/upstream-docs-$*
Owner

See above

See above
jolheiser marked this conversation as resolved
jolheiser added 1 commit 2023-07-27 22:43:33 +00:00
chore: remove commented out lines in Makefile
Signed-off-by: jolheiser <john.olheiser@gmail.com>
All checks were successful
checks / build-docs (pull_request) Successful in 6m31s
2cbac26fbf
delvh approved these changes 2023-07-27 23:35:16 +00:00
jolheiser added 1 commit 2023-07-27 23:47:22 +00:00
review(denyskon): update check_outdated comment
Signed-off-by: jolheiser <john.olheiser@gmail.com>
All checks were successful
checks / build-docs (pull_request) Successful in 6m39s
13d473a7df
Owner

Could we just clone the special branches but not all?

Could we just clone the special branches but not all?
Author
Owner

Could we just clone the special branches but not all?

Possibly, but I'm not sure how much that will improve it since main will have the most refs anyways

> Could we just clone the special branches but not all? Possibly, but I'm not sure how much that will improve it since main will have the most refs anyways
jolheiser added 1 commit 2023-07-28 04:41:39 +00:00
Merge branch 'main' into clone-once
All checks were successful
checks / build-docs (pull_request) Successful in 6m30s
a6c7e7adec
lunny approved these changes 2023-07-28 05:10:55 +00:00
denyskon approved these changes 2023-07-28 05:22:57 +00:00
lunny merged commit 53e27a0e86 into main 2023-07-28 05:52:36 +00:00
lunny referenced this issue from a commit 2023-07-28 05:52:37 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 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: gitea/gitea-docusaurus#52
No description provided.