Skip to content

Commit

Permalink
Merge branch 'master' into notif-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
iNPUTmice authored Jun 5, 2024
2 parents 9a3bc4c + 5a0e3e9 commit 19b84f8
Show file tree
Hide file tree
Showing 238 changed files with 12,883 additions and 1,204 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/auto-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Triage
on:
pull_request_target:
types:
- opened
- edited
branches:
- master
paths:
- 'xep-*.xml'
jobs:
label_pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxml2-utils
version: cachetag1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy trusted version of script
run: cp tools/github_auto_triage_pr.sh /tmp
- name: Setup PR branch locally
run: gh pr checkout ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
- run: bash /tmp/github_auto_triage_pr.sh ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
41 changes: 41 additions & 0 deletions .github/workflows/xep-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: XEP validation

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
name: Validate any XEP changes
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changes to XEP files
id: changed-xeps
uses: tj-actions/changed-files@v41
with:
files: |
xep-*.xml
inbox/*
- name: Validate changed file(s)
if: steps.changed-xeps.outputs.any_changed == 'true'
run: |
sudo apt-get install -y libxml2-utils
result=0
for xep in "${{ steps.changed-xeps.outputs.all_changed_files }}"; do
if ! tools/validate-xep0001-conformance.sh "$xep"; then
result=1
fi
if [[ ${xep} == xep-* ]]; then
echo Checking ${xep} by invoking \"make .${xep}.check.ok\"
if ! make ".${xep}.check.ok"; then
result=1
fi
fi
done
exit $result
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ Session.vim
*~

*.pdf
/tools/old-xeplist.xml
/tools/xeps-email.conf
/tmp/
/pr-worktree/

.*.xml.check.ok
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ possibility of such damages.

This XMPP Extension Protocol has been contributed in full conformance
with the XSF's Intellectual Property Rights Policy (a copy of which may
be found at http://www.xmpp.org/extensions/ipr-policy.shtml or obtained
be found at https://xmpp.org/about/xsf/ipr-policy/ or obtained
by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).

29 changes: 13 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.SILENT:

OUTDIR?=build
REFSDIR?=$(OUTDIR)/refs
EXAMPLESDIR?=$(OUTDIR)/examples
Expand Down Expand Up @@ -36,6 +34,7 @@ xep_pdfs=$(patsubst %.xml,$(OUTDIR)/%.pdf,$(xeps))
xep_refs=$(patsubst xep-%.xml, $(REFSDIR)/reference.XSF.XEP-%.xml, $(xeps))
xep_examples=$(patsubst xep-%.xml, $(EXAMPLESDIR)/%.xml, $(xeps))

all_xep_check_ok=$(patsubst %.xml, .%.xml.check.ok, $(xeps))

.PHONY: help
help:
Expand All @@ -46,6 +45,7 @@ help:
@echo ' refs - build all IETF refs'
@echo ' html - build all XEPs'
@echo ' inbox-html - build all ProtoXEPs'
@echo ' check - check all XEPs for errors'
@echo ' clean - recursively unlink the build tree'
@echo ' preview - builds html whenever an XEP changes (requires inotify-tools)'
@echo ' examples - extract all examples'
Expand Down Expand Up @@ -82,6 +82,9 @@ refs: $(xep_refs)
.PHONY: examples
examples: $(xep_examples)

.PHONY: check
check: $(all_xep_check_ok)

.PHONY: xep-%
xep-%: $(OUTDIR)/xep-%.html $(REFSDIR)/reference.XSF.XEP-%.xml $(OUTDIR)/xep-%.pdf $(EXAMPLESDIR)/%.xml;

Expand All @@ -97,7 +100,7 @@ $(all_xep_xmls): $(OUTDIR)/%.xml: %.xml $(XMLDEPS)
$(OUTDIR)/xep.xsl: xep.xsl $(OUTDIR)
cp $< $@

$(OUTDIR)/xeplist.xml: $(wildcard *.xml) $(wildcard inbox/*.xml)
$(OUTDIR)/xeplist.xml: $(wildcard *.xml) $(wildcard inbox/*.xml) $(OUTDIR)
./tools/extract-metadata.py > $@

$(EXAMPLESDIR)/%.xml: xep-%.xml $(XMLDEPS) examples.xsl | $(EXAMPLESDIR)
Expand All @@ -106,30 +109,24 @@ $(EXAMPLESDIR)/%.xml: xep-%.xml $(XMLDEPS) examples.xsl | $(EXAMPLESDIR)
$(REFSDIR)/reference.XSF.XEP-%.xml: xep-%.xml $(XMLDEPS) ref.xsl | $(REFSDIR)
xsltproc --path $(CURDIR) ref.xsl "$<" > "$@" && echo "Finished building $@"

$(xep_htmls): $(OUTDIR)/xep-%.html: xep-%.xml $(XMLDEPS) $(HTMLDEPS) | $(OUTDIR)
.%.xml.check.ok: %.xml
xmllint --nonet --noout --noent --loaddtd --valid "$<"
# Check for non-data URIs
! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true
# Check for non-data URIs, the result set of the XPath expression below should be empty
# Disabled for now, see
# https://github.com/xsf/xeps/issues/1316 and https://gitlab.gnome.org/GNOME/libxml2/-/issues/673
# xmllint --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< > /dev/null
touch $@

# Actually build the HTML
$(xep_htmls): $(OUTDIR)/xep-%.html: xep-%.xml $(XMLDEPS) $(HTMLDEPS) | $(OUTDIR)
xsltproc --path $(CURDIR) --param htmlbase "$(if $(findstring inbox,$<),'../','./')" xep.xsl "$<" > "$@" && echo "Finished building $@"

$(proto_xep_htmls): $(OUTDIR)/inbox/%.html: inbox/%.xml $(XMLDEPS) $(proto_HTMLDEPS) | $(OUTDIR)
xmllint --nonet --noout --noent --loaddtd --valid "$<"
# Check for non-data URIs
! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true

# Actually build the HTML
xsltproc --path $(CURDIR) --param htmlbase "$(if $(findstring inbox,$<),'../','./')" xep.xsl "$<" > "$@" && echo "Finished building $@"

$(OUTDIR)/xmpp.pdf $(OUTDIR)/xmpp-text.pdf: | $(OUTDIR)
cp "resources/$(notdir $@)" "$@"

$(OUTDIR)/%.pdf: %.xml $(XMLDEPS) $(TEXMLDEPS)
xmllint --nonet --noout --noent --loaddtd --valid "$<"
# Check for non-data URIs
! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true

xsltproc --path $(CURDIR) xep2texml.xsl "$<" > "$(@:.pdf=.tex.xml)"
texml -e utf8 "$(@:.pdf=.tex.xml)" "$(@:.pdf=.tex)"
sed -i -e 's|\([\s"]\)\([^"]http://[^ "]*\)|\1\\path{\2}|g' \
Expand Down
6 changes: 3 additions & 3 deletions docs/TRIAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ If the PR is not touching a XEP, this guide does not apply.
1. Make sure the standards@ discussion (if it exists) is linked in the
PR.
2. Add the [Needs Author] label.
3. Try to make the XEP Author aware of the change. If you do not know
a GitHub handle of the XEP Author, use the contact info available
for each author in either the XEP or in xep.ent.
3. Try to make the XEP Author aware of the change. Do this with an email to
the author (use the contact info available for each author in either the
XEP or in xep.ent) and cc: standards@.
4. Stop.

5. Otherwise, mark the PR as [Ready to Merge], linking the XEP Author’s
Expand Down
Loading

0 comments on commit 19b84f8

Please sign in to comment.