Skip to content

Commit e100b4c

Browse files
committed
Merge with upstream.
2 parents 87f7771 + b013669 commit e100b4c

35 files changed

+760
-380
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- checkout
1515
- setup_remote_docker:
16-
version: 20.10.6
16+
version: default
1717

1818
- run:
1919
name: "Build Docker Image"

.github/workflows/docker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: "Checkout"
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
- name: "Configure"
2929
id: config
@@ -57,28 +57,28 @@ jobs:
5757
echo "math_tags=$math_tags" >>"$GITHUB_OUTPUT"
5858
5959
- name: "Setup Docker Buildx"
60-
uses: docker/setup-buildx-action@v2
60+
uses: docker/setup-buildx-action@v3
6161
with:
6262
driver-opts: ${{ steps.config.outputs.driver_opts }}
6363

6464
- name: "Login to GitHub Container Registry"
6565
if: ${{ steps.config.outputs.label != 'test' }}
66-
uses: docker/login-action@v2
66+
uses: docker/login-action@v3
6767
with:
6868
registry: ghcr.io
6969
username: ${{ secrets.GHCR_USERNAME }}
7070
password: ${{ secrets.GHCR_PASSWORD }}
7171

7272
- name: "Build and Publish GitHub Actions Image"
73-
uses: docker/build-push-action@v3
73+
uses: docker/build-push-action@v6
7474
with:
7575
context: ./docker/action
7676
file: ./docker/action/Dockerfile
7777
push: true
7878
tags: ${{ steps.config.outputs.action_tags }}
7979

8080
- name: "Build and Publish CircleCI Image"
81-
uses: docker/build-push-action@v3
81+
uses: docker/build-push-action@v6
8282
with:
8383
context: ./docker/circleci
8484
file: ./docker/circleci/Dockerfile
@@ -89,7 +89,7 @@ jobs:
8989
tags: ${{ steps.config.outputs.circle_tags }}
9090

9191
- name: "Build and Publish Math Image"
92-
uses: docker/build-push-action@v3
92+
uses: docker/build-push-action@v6
9393
with:
9494
context: ./docker/math
9595
file: ./docker/math/Dockerfile

.github/workflows/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: "Checkout"
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
- name: "Verify Gemfile and requirements.txt consistency"
2626
run: |

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
source 'https://rubygems.org'
22

33
gem 'kramdown-rfc'
4-
gem 'net-http-persistent'

config.mk

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ kramdown-rfc ?= kramdown-rfc
2727
export KRAMDOWN_NO_TARGETS := true
2828
export KRAMDOWN_PERSISTENT := true
2929

30+
# Use an emoji for the favicon
31+
FAVICON_EMOJI ?=
32+
ifneq (,$(FAVICON_EMOJI))
33+
FAVICON ?= <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>$(FAVICON_EMOJI)</text></svg>">
34+
endif
35+
3036
# mmark (https://github.com/mmarkdown/mmark)
3137
mmark ?= mmark
3238

@@ -39,7 +45,7 @@ oxtradoc ?= oxtradoc.in
3945
xsltproc ?= xsltproc
4046

4147
# For sanity checkout your draft:
42-
# https://www.ietf.org/tools/idnits
48+
# https://github.com/ietf-tools/idnits
4349
idnits ?= idnits
4450

4551
# For diff:
@@ -89,6 +95,15 @@ else
8995
ifeq (,$(KRAMDOWN_REFCACHEDIR))
9096
ifeq (true,$(CI))
9197
XML2RFC_REFCACHEDIR := $(realpath .)/.refcache
98+
# In CI, only cache drafts for 5 minutes to pick up on recent updates.
99+
export KRAMDOWN_REFCACHETTL := 300
100+
else
101+
# When running locally, cache drafts for a week.
102+
export KRAMDOWN_REFCACHETTL_RFC := 23673600
103+
# Cache IANA and DOI for 3 months since they change rarely.
104+
export KRAMDOWN_REFCACHETTL := 604800
105+
# Cache RFCs for 9 months since they are immutable.
106+
export KRAMDOWN_REFCACHETTL_DOI_IANA := 7776000
92107
endif
93108
XML2RFC_REFCACHEDIR ?= $(HOME)/.cache/xml2rfc
94109
KRAMDOWN_REFCACHEDIR := $(XML2RFC_REFCACHEDIR)

deps.mk

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@
104104

105105
.PHONY: deps clean-deps update-deps
106106

107+
# Make really doesn't handle spaces in filenames well.
108+
# Using $(realpath) exposes make to spaces in directory names above this one.
109+
# Though we might prefer to use $(realpath), this function operates a fallback
110+
# so that the full path is not used if there are spaces in directory names.
111+
ifeq ($(words $(realpath $(LIBDIR))),1)
112+
safe-realpath = $(realpath $(1))
113+
relative-paths := false
114+
else
115+
ifneq (,$(DISABLE_SPACES_WARNING))
116+
$(warning Your $$LIBDIR ($(LIBDIR)) contains spaces; some things might break.)
117+
endif
118+
safe-realpath = $(1)
119+
relative-paths := true
120+
endif
121+
107122
ifeq (true,$(DISABLE_CACHE))
108123
no-cache := --no-cache
109124
no-cache-dir := --no-cache-dir
@@ -114,10 +129,10 @@ endif
114129

115130
ifeq (true,$(CI))
116131
# Override VENVDIR so we can use caching in CI.
117-
VENVDIR = $(realpath .)/.venv
132+
VENVDIR = $(call safe-realpath,.)/.venv
118133
endif
119134

120-
VENVDIR ?= $(realpath $(LIBDIR))/.venv
135+
VENVDIR ?= $(call safe-realpath,$(LIBDIR))/.venv
121136
REQUIREMENTS_TXT := $(wildcard requirements.txt)
122137

123138
ifneq (,$(strip $(REQUIREMENTS_TXT)))
@@ -137,7 +152,7 @@ ifeq (true,$(CI))
137152
# Under CI, install from the local requirements.txt, but install globally (no venv).
138153
pip ?= pip3
139154
$(LOCAL_VENV):
140-
$(pip) install $(no-cache-dir) $(foreach path,$(REQUIREMENTS_TXT),-r $(path))
155+
"$(pip)" install --no-user $(no-cache-dir) $(foreach path,$(REQUIREMENTS_TXT),-r $(path))
141156
@touch $@
142157

143158
# No clean-deps target in CI..
@@ -162,8 +177,8 @@ endif
162177
clean-deps:: clean-venv
163178
endif # CI
164179
update-deps::
165-
$(pip) install $(no-cache-dir) --upgrade --upgrade-strategy eager \
166-
$(foreach path,$(REQUIREMENTS_TXT),-r $(path))
180+
"$(pip)" install --no-user $(no-cache-dir) --upgrade --upgrade-strategy eager \
181+
$(foreach path,$(REQUIREMENTS_TXT),-r "$(path)")
167182
endif # -e requirements.txt
168183

169184
# Variable defaults for CI
@@ -183,42 +198,55 @@ BUNDLE_IGNORE_MESSAGES := true
183198
export BUNDLE_IGNORE_MESSAGES
184199
ifeq (true,$(CI))
185200
# Override BUNDLE_PATH so we can use caching in CI.
186-
BUNDLE_PATH := $(realpath .)/.gems
201+
BUNDLE_PATH := $(call safe-realpath,.)/.gems
187202
BUNDLE_DISABLE_VERSION_CHECK := true
188203
export BUNDLE_DISABLE_VERSION_CHECK
189204
endif
190-
export BUNDLE_PATH ?= $(realpath $(LIBDIR))/.gems
205+
BUNDLE_PATH ?= $(call safe-realpath,$(LIBDIR))/.gems
191206
# Install binaries to somewhere sensible instead of .../ruby/$v/bin where $v
192207
# doesn't even match the current ruby version.
193-
export BUNDLE_BIN := $(BUNDLE_PATH)/bin
208+
BUNDLE_BIN := $(BUNDLE_PATH)/bin
194209
export PATH := $(BUNDLE_BIN):$(PATH)
210+
ifeq (true,$(relative-paths))
211+
# This means that BUNDLE_PATH is relative, which bundler will interpret
212+
# as being relative to the Gemfile, not the current directory, so tweak
213+
# the two path settings for bundler. After setting $PATH.
214+
# Thankfully, we don't install from $(LIBDIR)/Gemfile in CI, which
215+
# would mean that this would need to be "../.gems" there.
216+
$(warning Using a relative path for bundler)
217+
bundle-path-override-lib := BUNDLE_PATH=$(LIBDIR)/.gems BUNDLE_BIN=$(LIBDIR)/.gems/bin
218+
bundle-path-override := BUNDLE_PATH=.gems BUNDLE_BIN=.gems/bin
219+
endif
220+
export BUNDLE_PATH
221+
export BUNDLE_BIN
222+
195223

196224
ifneq (,$(wildcard Gemfile))
197225
# A local Gemfile exists.
198226
DEPS_FILES += Gemfile.lock
199227
Gemfile.lock: Gemfile
200-
bundle install $(no-cache) --gemfile=$(realpath $<)
228+
$(bundle-path-override-lib) bundle install $(no-cache) --gemfile="$(call safe-realpath,$<)"
201229
@touch $@
202230

203231
update-deps:: Gemfile
204-
bundle update $(bundle-update-all) --gemfile=$(realpath $<)
232+
$(bundle-path-override-lib) bundle update $(bundle-update-all) --gemfile="$(call safe-realpath,$<)"
205233

206234
clean-deps::
207-
-rm -rf $(BUNDLE_PATH)
235+
-rm -rf "$(BUNDLE_PATH)"
208236
endif # Gemfile
209237

210238
ifneq (true,$(CI))
211239
# Install kramdown-rfc.
212240
DEPS_FILES += $(LIBDIR)/Gemfile.lock
213241
$(LIBDIR)/Gemfile.lock: $(LIBDIR)/Gemfile
214-
bundle install $(no-cache) --gemfile=$(realpath $<)
242+
$(bundle-path-override) bundle install $(no-cache) --gemfile="$(call safe-realpath,$<)"
215243
@touch $@
216244

217245
update-deps:: $(LIBDIR)/Gemfile
218-
bundle update $(bundle-update-all) --gemfile=$(realpath $<)
246+
$(bundle-path-override) bundle update $(bundle-update-all) --gemfile="$(call safe-realpath,$<)"
219247

220248
clean-deps::
221-
-rm -rf $(BUNDLE_PATH)
249+
-rm -rf "$(BUNDLE_PATH)"
222250
endif # !CI
223251
endif # !NO_RUBY
224252

@@ -232,8 +260,8 @@ NO_NODEJS := true
232260
endif
233261

234262
ifneq (true,$(NO_NODEJS))
235-
ifneq (,$(wildcard package.json))
236263
export PATH := $(abspath node_modules/.bin):$(PATH)
264+
ifneq (,$(wildcard package.json))
237265
DEPS_FILES += package-lock.json
238266
package-lock.json: package.json
239267
npm install

doc/FEATURES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ $ make
77
Turn internet-draft source into text and HTML. This supports XML files using
88
[xml2rfc](https://xml2rfc.tools.ietf.org/), markdown files using either
99
[kramdown-rfc](https://github.com/cabo/kramdown-rfc) or
10-
[mmark](https://github.com/miekg/mmark)
10+
[mmark](https://github.com/miekg/mmark).
11+
12+
Multiple files can be managed in the same repository. This only requires the
13+
addition of the source files for each draft, though you might choose to
14+
[update](https://github.com/martinthomson/i-d-template/blob/main/doc/UPDATE.md#automatically-generated-files)
15+
some files.
1116

1217
```sh
1318
$ make diff
@@ -60,6 +65,11 @@ $ make issues
6065

6166
Download a copy of GitHub issues and pull requests.
6267

68+
If there are surprising errors, this may help:
69+
```sh
70+
$ make clean
71+
```
72+
6373

6474
## Setup a Repository
6575

doc/SETUP.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ These tools work well natively on Linux and Mac.
1919

2020
Windows users should use [the Windows Subsystem for
2121
Linux](https://docs.microsoft.com/en-us/windows/wsl/install) with a Linux
22-
distribution like Ubuntu (`wsl --install -d Ubuntu`) to get `make`.
22+
distribution like Ubuntu (`wsl --install -d Ubuntu` from an administrator
23+
prompt).
24+
25+
From within Ubuntu, you can install the dependencies for this repository:
26+
27+
```sh
28+
sudo apt-get install -y git make python3-pip python3-venv
29+
```
30+
31+
You can also add recommended packages, as follows:
32+
33+
```sh
34+
sudo apt-get install -y ruby-bundler npm libxml2-utils
35+
```
2336

2437
It is also possible to use [cygwin](https://cygwin.org/) or an
2538
[MSYS2](https://www.msys2.org/)-based system (like

doc/SUBMITTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,36 @@ This will attribute the submission to the first author listed in the draft, no
6868
matter who generated the release, just like with a lightweight tag.
6969

7070

71+
## Picking an Email
72+
73+
The IETF datatracker is quite picky about the email that is associated with a
74+
submission. To work around that, there are several ways email addresses are
75+
chosen for a submission.
76+
77+
1. An email address can be set when manually running the GitHub action.
78+
This isn't a common way of requesting submission, but you might manually run
79+
the action if a build fails.
80+
81+
3. Setting a variable called `UPLOAD_EMAIL` in your Makefile. Make sure to
82+
export the value:
83+
84+
```make
85+
export UPLOAD_EMAIL ?= [email protected]
86+
```
87+
88+
3. The email address you used to create the tag (annotated tags only).
89+
This will come from your git configuration.
90+
91+
4. Your GitHub account email address.
92+
93+
5. The email address of the first author in the draft.
94+
95+
You can tell datatracker about your email address(es)
96+
[here](https://datatracker.ietf.org/accounts/profile/). You might need to
97+
ensure that the first email the above process finds is the primary address
98+
known to the datatracker.
99+
100+
71101
## If the Build Fails
72102

73103
Sometimes the build will fail. Some errors can be worked around by retrying the

doc/TEMPLATE.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ simple process.
1010
1. [Create a new repository using the
1111
template](https://github.com/martinthomson/internet-draft-template/generate).
1212
Check "Include all branches", or you will need to enable GitHub Pages
13-
manually after step 2.
14-
15-
2. Allow GitHub Workflows to make changes to the repository. Click the gear icon
16-
to open the settings for your repo, then select Actions > General in the list
17-
on the left. Under "Workflow permissions", select "Read and write permissions".
13+
manually.
1814

19-
3. Rename your I-D and add a title. The newly created repository will contain
15+
2. Rename your I-D and add a title. The newly created repository will contain
2016
a link to a page where you can do this using the GitHub editor. Setup will
2117
automatically run. Setup should be done in less than a minute.
2218

0 commit comments

Comments
 (0)