Skip to content

Commit d832e48

Browse files
committed
Adding a limits element.
Also, adding tests and updating the CI workflow.
1 parent 19b3a22 commit d832e48

File tree

9 files changed

+475
-139
lines changed

9 files changed

+475
-139
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# This file generated from a template file maintained in the ivoatex repository.
2+
# To create and install it into a project repository, do:
3+
# make github-preview
4+
# git commit
5+
# git push
6+
#
17
name: Check the IVOA document
28

39
env:
@@ -11,29 +17,32 @@ jobs:
1117
build:
1218

1319
runs-on: ubuntu-latest
14-
20+
1521
steps:
16-
22+
1723
- name: Checkout the repository
18-
uses: actions/checkout@v1
24+
uses: actions/checkout@v4
1925
with:
2026
submodules: true
21-
27+
2228
- name: Setup dependencies
2329
run: |
2430
sudo apt update
25-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
26-
31+
sudo apt install texlive-latex-base texlive-latex-recommended \
32+
texlive-latex-extra texlive-fonts-recommended \
33+
librsvg2-bin latexmk \
34+
pdftk xsltproc latexmk cm-super
35+
2736
- name: Build the document
2837
run: make
29-
38+
3039
- name: Check the output
3140
run: |
3241
test -f ${{ env.doc_name }}.pdf
3342
test -f ${{ env.doc_name }}.bbl
34-
35-
- name: Keep the PDF artefact
36-
uses: actions/upload-artifact@v1
43+
44+
- name: Keep the PDF artefact
45+
uses: actions/upload-artifact@v4
3746
with:
3847
name: PDF Preview
3948
path: ${{ env.doc_name }}.pdf

.github/workflows/preview.yml

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,73 @@
1+
# This file generated from a template file maintained in the ivoatex repository.
2+
# To create and install it into a project repository, do:
3+
# make github-preview
4+
# git commit
5+
# git push
6+
#
17
name: Update PDF Preview
28

39
env:
4-
doc_name: TAPRegExt
10+
doc_name : TAPRegExt
11+
branch_name: ${{ github.head_ref || github.ref_name }}
12+
tag_preview: auto-pdf-preview
513

614
on:
715
push:
816
branches:
9-
- master
17+
- main
1018

1119
jobs:
1220
build:
13-
21+
1422
runs-on: ubuntu-latest
15-
23+
1624
steps:
17-
25+
1826
- name: Checkout the repository
19-
uses: actions/checkout@v1
27+
uses: actions/checkout@v4
2028
with:
2129
submodules: true
22-
30+
2331
- name: Setup dependencies
2432
run: |
25-
sudo apt update
26-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
27-
sudo snap install pdftk
28-
33+
sudo apt install texlive-latex-base texlive-latex-recommended \
34+
texlive-latex-extra texlive-fonts-recommended \
35+
librsvg2-bin latexmk \
36+
pdftk xsltproc latexmk cm-super
37+
2938
- name: Build the document
3039
run: make ${{ env.doc_name }}-draft.pdf
31-
40+
3241
- name: Check the output
3342
run: |
3443
test -f ${{ env.doc_name }}-draft.pdf
3544
test -f ${{ env.doc_name }}.bbl
36-
37-
- name: Move the auto-pdf-preview tag
38-
uses: weareyipyip/walking-tag-action@v1
39-
with:
40-
TAG_NAME: auto-pdf-preview
41-
TAG_MESSAGE: |
42-
Last commit taken into account for the automatically updated PDF preview of this IVOA document.
45+
46+
- name: Remove the former PDF preview (if any)
47+
run: |
48+
existingTag=$( gh release list --exclude-drafts --json 'isPrerelease,tagName' \
49+
--jq '.[] | select(.isPrerelease == true and .tagName == "${{ env.tag_preview }}") | .tagName' \
50+
| xargs -n 1 echo )
51+
if [ -n "$existingTag" ];
52+
then
53+
gh release delete --cleanup-tag "$existingTag"
54+
fi
4355
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
46-
- name: Update the PDF preview
47-
uses: Xotl/cool-github-releases@v1
48-
with:
49-
mode: update
50-
isPrerelease: true
51-
tag_name: auto-pdf-preview
52-
release_name: "Auto PDF Preview"
53-
body_mrkdwn: |
54-
This release aims to provide a PDF preview of the last commit applied on this repository.
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Upload the new PDF preview
59+
run: |
60+
RELEASE_NOTES="This release aims to provide a PDF preview of the last commit applied on this repository.
5561
It will be updated automatically after each merge of a PullRequest.
56-
**DO NOT PUBLISH THIS PRE-RELEASE!**"
57-
_Corresponding commit: ${{ github.sha }}_
58-
assets: ${{ env.doc_name }}-draft.pdf
59-
replace_assets: true
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
62+
**DO NOT PUBLISH THIS PRE-RELEASE!**
63+
_Corresponding commit: ${{ github.sha }}_"
64+
65+
gh release create ${{ env.tag_preview }} \
66+
${{ env.doc_name }}-draft.pdf \
67+
--prerelease \
68+
--target "${{ env.branch_name }}" \
69+
--title 'Auto PDF Preview' \
70+
--notes "$RELEASE_NOTES"
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ AUX_FILES = $(SCHEMA_FILE) sample.xml
3434

3535
sample.xml: make-sample.sh
3636
./make-sample.sh > sample.xml
37-
37+
3838
install:
3939
# local to Markus' setup
4040
~/gavo/standards/fixschema $(SCHEMA_FILE) > ~/gavo/trunk/gavo/resources/schemata/TAPRegExt.xsd
@@ -43,3 +43,17 @@ ivoatex/Makefile:
4343
@echo "*** ivoatex submodule not found. Initialising submodules."
4444
@echo
4545
git submodule update --init
46+
47+
STILTS ?= stilts
48+
SCHEMA_FILE=TAPRegExt-v1.1.xsd
49+
50+
# These tests need stilts >3.4 and xmlstarlet
51+
test:
52+
@sh test-assertions.sh
53+
@$(STILTS) xsdvalidate $(SCHEMA_FILE)
54+
@$(STILTS) xsdvalidate \
55+
schemaloc="http://www.ivoa.net/xml/TAPRegExt/v1.0=$(SCHEMA_FILE)" \
56+
schemaloc="http://www.ivoa.net/xml/VOSICapabilities/v1.0=https://www.ivoa.net/xml/VOSICapabilities/v1.0" \
57+
schemaloc="http://www.ivoa.net/xml/VODataService/v1.1=https://www.ivoa.net/xml/VODataService/v1.1" \
58+
doc=sample.xml
59+

TAPRegExt-v1.1.xsd

Lines changed: 111 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema"
44
xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
55
xmlns:vm="http://www.ivoa.net/xml/VOMetadata/v0.1"
66
xmlns:tr="http://www.ivoa.net/xml/TAPRegExt/v1.0"
7-
version="1.1-pre1"
7+
version="1.1-pre2"
88
targetNamespace="http://www.ivoa.net/xml/TAPRegExt/v1.0"
99
elementFormDefault="unqualified"
1010
attributeFormDefault="unqualified"
1111
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12-
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://vo.ari.uni-heidelberg.de/docs/schemata/XMLSchema.xsd">
12+
>
1313
<xs:annotation>
1414
<xs:appinfo>
1515
<vm:schemaName>TAPRegExt</vm:schemaName>
@@ -82,8 +82,9 @@ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://vo.ari.uni-heidelber
8282
minOccurs="0" maxOccurs="1">
8383
<xs:annotation>
8484
<xs:documentation>
85-
Limits on the time between job creation and
86-
destruction time.
85+
Limits for how long a service will retain async jobs
86+
for the service's default access
87+
mode (typically anonymous-sync).
8788
</xs:documentation>
8889
</xs:annotation>
8990
</xs:element>
@@ -92,7 +93,9 @@ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://vo.ari.uni-heidelber
9293
minOccurs="0" maxOccurs="1">
9394
<xs:annotation>
9495
<xs:documentation>
95-
Limits on executionDuration.
96+
Limits on the time after which a query will be cancelled
97+
for the service's default access mode (typically
98+
anonymous-sync).
9699
</xs:documentation>
97100
</xs:annotation>
98101
</xs:element>
@@ -101,7 +104,9 @@ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://vo.ari.uni-heidelber
101104
minOccurs="0" maxOccurs="1">
102105
<xs:annotation>
103106
<xs:documentation>
104-
Limits on the size of data returned.
107+
Limits on the size of data returned
108+
for the service's default access mode (typically
109+
anonymous-sync).
105110
</xs:documentation>
106111
</xs:annotation>
107112
</xs:element>
@@ -110,12 +115,21 @@ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://vo.ari.uni-heidelber
110115
minOccurs="0" maxOccurs="1">
111116
<xs:annotation>
112117
<xs:documentation>
113-
Limits on the size of uploaded data.
118+
Limits on the size of uploaded data
119+
for the service's default access mode (typically
120+
anonymous-sync).
114121
</xs:documentation>
115122
</xs:annotation>
116123
</xs:element>
117124

118-
125+
<xs:element name="limits" type="tr:PerModeLimits"
126+
minOccurs="0">
127+
<xs:annotation>
128+
<xs:documentation>
129+
Per-mode overrides of the limits defined gobally.
130+
</xs:documentation>
131+
</xs:annotation>
132+
</xs:element>
119133
</xs:sequence>
120134
</xs:extension>
121135
</xs:complexContent>
@@ -602,4 +616,93 @@ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://vo.ari.uni-heidelber
602616
</xs:simpleContent>
603617
</xs:complexType>
604618

619+
<xs:complexType name="PerModeLimits">
620+
<xs:annotation>
621+
<xs:documentation>
622+
The limits corresponding to an access mode (auth/non-auth, sync/async).
623+
</xs:documentation>
624+
</xs:annotation>
625+
626+
<xs:sequence>
627+
<xs:element name="retentionPeriod" type="tr:TimeLimits"
628+
minOccurs="0" maxOccurs="1">
629+
<xs:annotation>
630+
<xs:documentation>
631+
Limits for how long a service will retain async jobs
632+
in this limit element's mode.
633+
</xs:documentation>
634+
</xs:annotation>
635+
</xs:element>
636+
637+
<xs:element name="executionDuration" type="tr:TimeLimits"
638+
minOccurs="0" maxOccurs="1">
639+
<xs:annotation>
640+
<xs:documentation>
641+
Limits on the time after which a query will be cancelled
642+
in this limit element's mode.
643+
</xs:documentation>
644+
</xs:annotation>
645+
</xs:element>
646+
647+
<xs:element name="outputLimit" type="tr:DataLimits"
648+
minOccurs="0" maxOccurs="1">
649+
<xs:annotation>
650+
<xs:documentation>
651+
Limits on the size of data returned
652+
in this limit element's mode.
653+
</xs:documentation>
654+
</xs:annotation>
655+
</xs:element>
656+
657+
<xs:element name="uploadLimit" type="tr:DataLimits"
658+
minOccurs="0" maxOccurs="1">
659+
<xs:annotation>
660+
<xs:documentation>
661+
Limits on the size of uploaded data
662+
in this limit element's mode.
663+
</xs:documentation>
664+
</xs:annotation>
665+
</xs:element>
666+
</xs:sequence>
667+
668+
<xs:attribute name="mode">
669+
<xs:simpleType>
670+
<xs:restriction base="xs:NMTOKEN">
671+
<xs:enumeration value="anonymous-sync">
672+
<xs:annotation>
673+
<xs:documentation>
674+
These limits apply to unauthenticated clients running
675+
synchronous queries.
676+
</xs:documentation>
677+
</xs:annotation>
678+
</xs:enumeration>
679+
<xs:enumeration value="anonymous-async">
680+
<xs:annotation>
681+
<xs:documentation>
682+
These limits apply to unauthenticated clients running
683+
asynchronous queries.
684+
</xs:documentation>
685+
</xs:annotation>
686+
</xs:enumeration>
687+
<xs:enumeration value="auth-sync">
688+
<xs:annotation>
689+
<xs:documentation>
690+
These limits apply to authenticated clients running
691+
synchronous queries.
692+
</xs:documentation>
693+
</xs:annotation>
694+
</xs:enumeration>
695+
<xs:enumeration value="auth-async">
696+
<xs:annotation>
697+
<xs:documentation>
698+
These limits apply to authenticated clients running
699+
asynchronous queries.
700+
</xs:documentation>
701+
</xs:annotation>
702+
</xs:enumeration>
703+
</xs:restriction>
704+
</xs:simpleType>
705+
</xs:attribute>
706+
707+
</xs:complexType>
605708
</xs:schema>

0 commit comments

Comments
 (0)