RFC Update 9fans.github.io to Use Git Submodules

14 views
Skip to first unread message

Eason Lu

unread,
Jun 17, 2024, 6:06:45 PM (2 days ago) Jun 17
to plan9p...@googlegroups.com, r...@swtch.com
Hi

I am looking for feedback on using git submodule to replace certain
folder in the 9fans.github.io's GitHub repo.

This change will:

1. Replace the usr/local/plan9 folder to be a submodule that is linked
to the main plan9port repo.

2. (This may or may not be possible) Replace the man folder to be a
submodule that is linked to the man folder in the main plan9port repo.

3. Add a GitHub action that will automatically update the submodules on
a schedule.

Thanks

--

Yours
Eason Lu

OpenPGP_0xA5ED17B135E98024.asc
OpenPGP_signature.asc

Dan Cross

unread,
Jun 17, 2024, 6:08:36 PM (2 days ago) Jun 17
to ael...@gmail.com, plan9p...@googlegroups.com, r...@swtch.com
On Mon, Jun 17, 2024 at 6:06 PM Eason Lu <ael...@gmail.com> wrote:
> I am looking for feedback on using git submodule to replace certain
> folder in the 9fans.github.io's GitHub repo.

Generally speaking, git submodules are a misfeature.

> This change will:
>
> 1. Replace the usr/local/plan9 folder to be a submodule that is linked
> to the main plan9port repo.
>
> 2. (This may or may not be possible) Replace the man folder to be a
> submodule that is linked to the man folder in the main plan9port repo.
>
> 3. Add a GitHub action that will automatically update the submodules on
> a schedule.

To what end? These changes seem superfluous.

- Dan C.

Eason Lu

unread,
Jun 17, 2024, 6:16:06 PM (2 days ago) Jun 17
to Dan Cross, plan9p...@googlegroups.com, r...@swtch.com
> To what end? These changes seem superfluous.
>
> - Dan C.

The change is so that maintainers don't need to constantly update the
website even if a small modification is done to the man pages.

The reason I proposed this is to make sure that the website is
reasonably up to date. And also help to automate commits like:
https://github.com/9fans/9fans.github.io/commit/6f9ee325640268bf9278fba1edd374cecd25c3de


--

Yours
Eason Lu

Dan Cross

unread,
Jun 17, 2024, 6:18:47 PM (2 days ago) Jun 17
to Eason Lu, plan9p...@googlegroups.com, r...@swtch.com
On Mon, Jun 17, 2024 at 6:12 PM Eason Lu <ael...@gmail.com> wrote:
> > To what end? These changes seem superfluous.
>
> The change is so that maintainers don't need to constantly update the
> website even if a small modification is done to the man pages.
>
> The reason I proposed this is to make sure that the website is
> reasonably up to date. And also help to automate commits like:
> https://github.com/9fans/9fans.github.io/commit/6f9ee325640268bf9278fba1edd374cecd25c3de

That seems like something that could be done with a shell script
that's run as e.g. a github action. But as one of the maintainers, my
opinion is that splitting apart the repository wouldn't be great.

Perhaps Russ has other thoughts, in which case I would defer to him.

- Dan C.

Eason Lu

unread,
Jun 17, 2024, 6:26:21 PM (2 days ago) Jun 17
to Dan Cross, plan9p...@googlegroups.com, r...@swtch.com
On 6/17/24 3:18 PM, Dan Cross wrote:
> That seems like something that could be done with a shell script
> that's run as e.g. a github action. But as one of the maintainers, my
> opinion is that splitting apart the repository wouldn't be great.

Thank you for the suggestion, that seems a way better idea, the entire
process can be done in a single GitHub action, I will make a patch and
send to the mailing list.

--
Yours
Eason Lu


Russ Cox

unread,
Jun 17, 2024, 8:20:25 PM (2 days ago) Jun 17
to Eason Lu, Dan Cross, plan9p...@googlegroups.com
It sounds like the conversation got to a good place without me. :-)

Submodules alone wouldn't have worked since the web site is 
mostly generated HTML that is not checked in to the repo.
The script would need to

./INSTALL
cd dist
mk man
mk publish

and arrange to have 9fans.github.io checked out in the right place
during mk publish.

Best,
Russ

ael...@gmail.com

unread,
Jun 18, 2024, 2:28:27 PM (yesterday) Jun 18
to plan9p...@googlegroups.com, Eason Lu
From: Eason Lu <ael...@gmail.com>

This Patch create a github action that build the project and update the website every day at 00:00 UTC.
---
.github/workflows/timedupdate.yml | 61 +++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
create mode 100644 .github/workflows/timedupdate.yml

diff --git a/.github/workflows/timedupdate.yml b/.github/workflows/timedupdate.yml
new file mode 100644
index 0000000..e3d47bc
--- /dev/null
+++ b/.github/workflows/timedupdate.yml
@@ -0,0 +1,61 @@
+name: Timed Update
+
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: "0 0 * * 0"
+
+permissions:
+ contents: write
+
+jobs:
+ Timed-Update:
+ runs-on: [ubuntu-latest]
+ steps:
+ - name: Checkout Main Repo
+ uses: actions/checkout@v4
+ with:
+ repository: 9fans/plan9port
+ path: /home/runner/work/9fans.github.io/9fans.github.io/plan9
+ - name: Checkout this Repo
+ uses: actions/checkout@v4
+ with:
+ repository: ${{ github.repository }}
+ path: /home/runner/work/9fans.github.io/9fans.github.io/web
+ - name: Install Dependecy
+ run: |
+ sudo apt-get update
+ sudo apt-get install build-essential xorg-dev tree
+ - name: Compile Plan9port
+ run: |
+ cd /home/runner/work/9fans.github.io/9fans.github.io/
+ sudo cp -r plan9 /usr/local
+ cd /usr/local/plan9
+ sudo ./INSTALL
+ - name: Update Web
+ run: |
+ cd /home/runner/work/9fans.github.io/9fans.github.io/web
+ cp -r /home/runner/work/9fans.github.io/9fans.github.io/plan9 /home/runner/work/9fans.github.io/9fans.github.io/web/usr/local/
+ cp -r /usr/local/plan9/dist /home/runner/work/9fans.github.io/9fans.github.io/web/plan9port
+ cp -r /usr/local/plan9/man /home/runner/work/9fans.github.io/9fans.github.io/web/plan9port
+ cp -r /usr/local/plan9/unix /home/runner/work/9fans.github.io/9fans.github.io/web/unix
+ - name: Commit and Push
+ run: |
+ cd /home/runner/work/9fans.github.io/9fans.github.io/web
+ git config --global user.email "ael...@gmail.com"
+ git config --global user.name "Eason Lu (Automated, Github Actions)"
+ git add .
+ if ! git diff --cached --exit-code &> /dev/null; then
+ git commit -m "Automated Update"
+ git push
+ else
+ git diff --cached --exit-code
+ echo "No changes to commit."
+ fi
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: web
+ path: /home/runner/work/9fans.github.io/9fans.github.io/web
+ retention-days: 1
+ compression-level: 0
--
2.43.0

Eason Lu

unread,
Jun 18, 2024, 2:28:31 PM (yesterday) Jun 18
to plan9p...@googlegroups.com, r...@swtch.com, Dan Cross
This patch is also submitted to github as a PR at
https://github.com/9fans/9fans.github.io/pull/6.

Yours
Eason
OpenPGP_0xA5ED17B135E98024.asc
OpenPGP_signature.asc
Reply all
Reply to author
Forward
0 new messages