Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,37 @@ jobs:
ci_to_main:
runs-on: ubuntu-latest
container:
image: 'ubuntu:24.04'
# node:20-bookworm provides Node 20 from the official Node image (no
# NodeSource, no distro-apt Node), and MongoDB 8.0 installs from the
# officially supported Debian bookworm repo. This keeps both Node and
# MongoDB on supported, reproducible sources at the same time.
image: 'node:20-bookworm'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I disagree about this change. You want CI to resemble as much as possible to the setup that users of lnp2pbot (in this case, the users that run a community with it) will use, i.e. a Linux distro. "node20-bookworm" is a blackbox, what Linux distro is that? You're also not in control anymore of what the owners of "node" put into that. You change your CI to that and is the easiest route for stopping to catch issues that a normal CI would catch when using ubuntu images.

steps:
- name: Update apt and install required packages
run: |
apt update --yes
apt install --yes sudo
apt-get update --yes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ToRyVand what's the point of this change? please don't stage irrelevant hunks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not stray — these hunks are the switch: node:20-bookworm ships Node, so the apt npm install goes away; canvas build deps become explicit (ubuntu's npm pulled them transitively); the ca-certificates workaround was 24.04-only. apt-get over apt is just the script-stable CLI, on lines rewritten anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

apt-get is more script-stable than apt? first time I hear about this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fair — it surprised me too. apt warns about it itself, but only when stdout isn't a terminal, which is exactly why you'd never see it interactively:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

man apt explains the reasoning: it's built as an end-user tool that's allowed to change behavior between versions, so it points scripts to apt-get, which keeps backward compatibility.

apt-get install --yes sudo curl git

sudo apt install --yes --no-install-recommends npm
# Dependencies required to compile the canvas package from source
sudo apt-get install --yes --no-install-recommends \
build-essential pkg-config libcairo2-dev libpango1.0-dev \
libjpeg-dev libgif-dev librsvg2-dev

sudo apt install --yes git
# one time fix to avoid permission problems later on
git config --global --add safe.directory "$GITHUB_WORKSPACE"

- uses: actions/checkout@v4

- name: Import MongoDB's public key for the package management system
run: |
sudo apt install --yes --no-install-recommends curl gnupg
sudo rm -f /etc/ssl/certs/ca-bundle.crt
sudo apt reinstall --yes ca-certificates
sudo update-ca-certificates
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
sudo apt-get install --yes --no-install-recommends curl gnupg

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ToRyVand same here

curl -fsSL https://pgp.mongodb.com/server-8.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \
--dearmor

- name: Install MongoDB
run: |
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
- name: Check Mongo version
Expand Down
Loading
Loading