Skip to content

Commit 9045bbf

Browse files
authored
Documentation & Copilot-instruction updates (#212)
* Improve how-to-contribute (styling and PR #210 follow-up) * Clean-up README - remove duplicate contributing guide * Make copilot PR reviews more precise & less noisy * Avoid PR-from-org-warning for home-organization and switch to using gh-markdown alert messages
1 parent 833a8e1 commit 9045bbf

File tree

4 files changed

+134
-62
lines changed

4 files changed

+134
-62
lines changed

.github/copilot-instructions.md

Lines changed: 107 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ This repository contains a SKOS vocabulary for catalysis. When reviewing pull re
99
**Problem:** New concepts in the SKOS vocabulary must be properly classified by linking them to the hierarchy through `skos:broader` relationships, eventually reaching one of the top concepts.
1010

1111
**What to look for:**
12-
- Excel files in `inbox-excel-vocabs/` with new concepts
12+
- Vocabulary PRs are initiated by uploading an Excel file to
13+
`inbox-excel-vocabs/` (transient: CI converts and removes it). Rely on the PR
14+
description and CI validation artifacts rather than the file’s continued
15+
presence in the branch.
1316
- Check if new concepts have `skos:broader` relationships defined
14-
- Verify the broader concepts eventually chain to a top concept like:
15-
- Process
16-
- Method
17-
- Material entity
18-
- Quality
19-
- Role
20-
- etc.
17+
- Verify the broader chain reaches one of Voc4Cat's top concepts:
18+
- Physical entity (`voc4cat:0000180`)
19+
- Non-temporal abstract entity (`voc4cat:0000181`)
20+
- Temporal abstract entity (`voc4cat:0000182`)
21+
- Common high-level children: Events (`voc4cat:0000183`), Actions (`voc4cat:0000184`), Processes (`voc4cat:0000185`)
22+
- Attributes (`voc4cat:0000186`)
2123

2224
**Suggested response:**
2325
```
@@ -33,6 +35,31 @@ Let me know if you need help identifying the appropriate parent concepts!
3335

3436
## General Guidance
3537

38+
### PR Review Style (Concise, no diff rehash)
39+
40+
- Summarize changes in plain language: what changed and why.
41+
- Do not restate or quote diffs, hunks, or line-by-line changes.
42+
- Do not link to individual file diffs; reference files only when necessary (path + short purpose).
43+
- Focus feedback on correctness, classification, scope, and follow-ups rather than code excerpts.
44+
- Keep the review brief, actionable, and non-repetitive with what the GitHub diff already shows.
45+
46+
### Choosing the Right Review Template
47+
48+
Use simple heuristics based on PR intent and CI signals:
49+
- Use the Vocabulary template when the PR clearly introduces vocabulary changes
50+
(e.g., PR description mentions an Excel upload or CI ran vocabulary
51+
validation). Direct `.ttl` edits should be flagged (TTLs are CI-generated).
52+
- Use the Docs / CI template when changes are in `docs/**`, Sphinx config (`docs/conf.py`), `.github/workflows/**`, tooling, or other infrastructure.
53+
- Mixed PRs: pick the primary area of change and mention secondary impacts briefly. If vocabulary + docs both change substantially, you may include two short sections using both templates.
54+
- Always avoid rehashing diffs; focus on correctness, classification, scope, build status, and next steps.
55+
56+
### File Discovery Hints
57+
58+
- Source Excel upload path: `inbox-excel-vocabs/voc4cat.xlsx` (transient; CI converts and removes it)
59+
- TTL files are CI-generated and read-only in reviews; use only for context
60+
- Glob for concept TTLs: `vocabularies/voc4cat/[0-9]*.ttl`
61+
- Regex for concept TTLs: `vocabularies/voc4cat/[0-9]{7}\.ttl`
62+
3663
### What Makes a Good Contribution
3764

3865
- **Small, focused changes**: Single concept additions or small groups (~20 concepts)
@@ -43,11 +70,10 @@ Let me know if you need help identifying the appropriate parent concepts!
4370

4471
### What to Check in PRs
4572

46-
1. **File locations**: Excel files must be in `inbox-excel-vocabs/`
47-
2. **File naming**: Keep as `voc4cat.xlsx`
48-
3. **No direct .ttl edits**: Turtle files should only be modified by CI
49-
4. **Documentation**: Changes should be described in PR description
50-
5. **Size**: Large contributions should be split into smaller PRs
73+
1. **Excel upload**: `inbox-excel-vocabs/voc4cat.xlsx` (if visible in the initial upload commit; CI may remove it after conversion)
74+
2. **No direct .ttl edits**: Turtle files should only be modified by CI
75+
3. **Documentation**: Changes should be described in PR description
76+
4. **Size**: Large contributions should be split into smaller PRs
5177

5278
### Helpful Resources
5379

@@ -76,7 +102,74 @@ Let me know if you need help identifying the appropriate parent concepts!
76102

77103
1. **Critical**: Organization account issues (blocks CI)
78104
2. **Important**: Missing classification (affects vocabulary quality)
79-
3. **Helpful**: Main branch usage (improves contributor workflow)
105+
3. **Helpful**: Main branch usage (improves contributor workflow), violation of vocabulary guidelines (assure quality)
80106
4. **Nice-to-have**: Documentation improvements, minor formatting
81107

82108
Focus feedback on critical and important issues first. Mention helpful suggestions but don't insist on them for small contributions.
109+
110+
## Review Templates
111+
112+
Use these templates to structure PR reviews. Keep them concise. Do not quote diffs or link to specific file hunks; summarize in plain language.
113+
114+
### Vocabulary PR Review Template
115+
116+
Scope:
117+
- Additions or changes in vocabulary (Excel upload is transient; TTLs are CI-generated and should not be edited directly)
118+
119+
```
120+
Summary: <1–3 sentences describing what changed and why>
121+
122+
Classification:
123+
- Each concept has skos:broader and a chain to a top concept
124+
(Physical entity, Non-temporal abstract entity, Temporal abstract entity [Events/Actions/Processes], Attributes)
125+
126+
Quality:
127+
- PrefLabel + definition present (EN) per concept
128+
- No direct .ttl edits; TTL generated by CI
129+
- Conformance to guidelines <https://github.com/nfdi4cat/voc4cat/blob/main/docs/docs_usage/guidelines.md>:
130+
British English; noun/noun-phrase form; duplicates avoided; appropriate
131+
hyphenation; no slashes; definitions concise and non-circular.
132+
133+
Suggestions (optional):
134+
- <brief, actionable improvements; keep it short>
135+
- If CI checks failed, add one bullet per failing job with a short, actionable
136+
hint (e.g., "Validation failed – fix missing skos:broader for 3 concepts").
137+
Do not paste logs; reference the job name/title only.
138+
139+
Issues (optional):
140+
- Blocking: <list only items that must be fixed before merge>
141+
- Follow-ups (non-blocking): <short bullets>
142+
143+
Next steps:
144+
- <what the author should do next; or "LGTM – ready to merge">
145+
```
146+
147+
### Docs / CI PR Review Template
148+
149+
Scope:
150+
- Area(s): docs pages, Sphinx config, CI workflow, tooling
151+
- Impact: user-facing docs, build pipeline, release process
152+
153+
```
154+
Summary: <1–3 sentences describing what changed and why>
155+
156+
Build / Checks:
157+
- Local/CI build status: <passes/fails + short note>
158+
- Preview/outputs: <describe availability; do not paste diffs>
159+
- If CI failed, summarize failing job names and add brief, actionable hints in
160+
Suggestions; avoid quoting logs.
161+
162+
Risk / Compatibility (optional):
163+
- Backwards-compatibility: <low/medium/high>
164+
- Notable trade-offs: <short bullets>
165+
166+
Issues (optional):
167+
- Blocking: <list only items that must be fixed before merge>
168+
- Follow-ups (non-blocking): <short bullets>
169+
170+
Suggestions (optional):
171+
- <brief, actionable improvements>
172+
173+
Next steps:
174+
- <what the author should do next; or "LGTM – ready to merge">
175+
```

.github/workflows/pr-checks.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
const isFork = headRepo !== baseRepo;
3939
const isFromMain = headRef === 'main';
4040
const isFromOrg = pr.head.repo.owner.type === 'Organization';
41+
const headOwnerLogin = pr.head.repo.owner.login;
42+
const baseOwnerLogin = pr.base.repo.owner.login;
4143
4244
// Log details - no user input in template literals for security
4345
console.log('PR number:', pr.number);
@@ -47,12 +49,16 @@ jobs:
4749
console.log('Is fork:', isFork);
4850
console.log('From main branch:', isFromMain);
4951
console.log('Owner type:', pr.head.repo.owner.type);
52+
console.log('Head owner login:', headOwnerLogin);
53+
console.log('Base owner login:', baseOwnerLogin);
5054
5155
core.setOutput('is_fork', isFork);
5256
core.setOutput('is_from_main', isFromMain);
5357
core.setOutput('is_from_org', isFromOrg);
5458
core.setOutput('head_ref', headRef);
5559
core.setOutput('head_repo', headRepo);
60+
core.setOutput('head_owner_login', headOwnerLogin);
61+
core.setOutput('base_owner_login', baseOwnerLogin);
5662
5763
return {
5864
isFork,
@@ -93,8 +99,9 @@ jobs:
9399
94100
Thank you for your contribution to voc4cat!
95101
96-
⚠️ We noticed that this pull request was submitted from the \`main\` branch of your fork.
97-
While this works, it can cause issues:
102+
> [!WARNING]
103+
> We noticed that this pull request was submitted from the \`main\` branch of your fork.
104+
> While this works, it can cause issues:
98105
99106
- It makes it harder to keep your fork updated with upstream changes
100107
- You won't be able to work on multiple PRs at once
@@ -114,7 +121,7 @@ jobs:
114121
});
115122
116123
- name: Post info about organization account
117-
if: steps.check-main-branch.outputs.is_from_org == 'true'
124+
if: steps.check-main-branch.outputs.is_from_org == 'true' && steps.check-main-branch.outputs.is_fork == 'true' && steps.check-main-branch.outputs.head_owner_login != steps.check-main-branch.outputs.base_owner_login
118125
uses: actions/github-script@v7
119126
with:
120127
script: |
@@ -142,8 +149,9 @@ jobs:
142149
143150
const commentBody = `Hi @${username}! 👋
144151
145-
⚠️ We noticed that this pull request comes from an organization account,
146-
which will prevent our CI workflow from working correctly.
152+
> [!CAUTION]
153+
> We noticed that this pull request comes from a fork under an organization account,
154+
> which will prevent our CI workflow from working correctly.
147155
148156
GitHub does not allow the "Allow edits from maintainers" option for forks in organizations (see [discussion](https://github.com/orgs/community/discussions/5634)).
149157
Our CI needs this permission to commit turtle files and clean up Excel files.

README.md

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ It uses the [voc4cat-tool](https://github.com/nfdi4cat/voc4cat-tool) and GitHub
1717
## Basic principles
1818

1919
Voc4cat makes contributing easy for everyone with a GitHub account.
20-
The process is essentially *(see further below for details,
21-
browse through our [step-by-step guide](https://nfdi4cat.github.io/voc4cat/docs_usage/published-guidelines-v2.html#contribution-step-by-step-guide),
22-
or read the guide in pdf form with screenshots of each step (https://zenodo.org/records/13757351)*.
20+
The process is essentially *(browse through our [step-by-step guide](https://nfdi4cat.github.io/voc4cat/docs_usage/how-to-contribute.html),
21+
or read the guide in pdf form with screenshots of each step (https://zenodo.org/records/13757351)*:
2322

2423
- Download the [most current vocabulary file (xlsx)](https://nfdi4cat.github.io/voc4cat/dev/voc4cat.xlsx),
2524
- Edit the vocabulary file in Excel,
@@ -78,44 +77,12 @@ Both services offer API access to voc4cat. Skosmos has more SKOS-specific featur
7877

7978
To discuss about the **voc4cat**-vocabulary maintained here, create an [issue](https://github.com/nfdi4cat/voc4cat/issues).
8079

81-
To contribute new concepts or collections or change existing ones, you may either submit your contributions as Excel/xlsx-file or (as an expert) as new/changed turtle file.
80+
To add new concepts or collections or change existing ones, please follow our [*"How to contribute?"*](https://nfdi4cat.github.io/voc4cat/docs_usage/how-to-contribute.html#) guide.
8281

8382
> Small contributions like adding a single concept are as valuable as bigger ones.
8483
> In fact if you plan a bigger change (50+ concepts), consider splitting up the additions/changes into smaller chunks
8584
> with max. ~20 changes to make the review process not too hard for the reviewers and you as author.
8685
87-
Here are the steps for submitting updates via Excel/xlsx:
88-
89-
<details>
90-
91-
- Get the Excel/xlsx-vocabulary file
92-
- The most recent version of the vocabulary is always available via GitHub-pages https://nfdi4cat.github.io/voc4cat/dev/voc4cat.xlsx
93-
- Make changes to the Excel file. If you want to add something new you need to [request a range of IDs](https://github.com/nfdi4cat/voc4cat/issues/new/choose) for you.
94-
- Create a fork of the voc4cat repository (if you don't yet have one) or pull the latest changes to your fork (via "Sync fork" button in GUI).
95-
- Create a feature branch for your contribution (via GitHub GUI or `git switch -c name-of-branch`)
96-
- Add the xlsx file to the feature branch into the folder `inbox-excel-vocabs`
97-
- The name of the file must match the vocabulary that you want to update. So do not change the filename, but keep `voc4cat.xlsx`.
98-
- Create a pull request with the updated Excel-file in this repository.
99-
- Please describe your changes and the motivation for the changes in the pull request note or link to an issue with this information.
100-
This will help reviewers to understand the proposed change and decide about it.
101-
- Your pull request will be processed automatically by a CI/CD pipeline that typically finishes in less than a minute.
102-
- Review the artifacts/logs generated by the CI pipeline.
103-
- The [workflow artifact](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts) will contain an updated xlsx file that is recreated from the updated turtle-files.
104-
- If all is good your contribution will be either
105-
- directly merged by the maintainers
106-
- or a discussion will be started about what else is needed
107-
- or why the proposed change may not fit.
108-
- If you need to fix something, first pull the changes made by the action with `git pull` (or "sync" in GUI) and then commit further changes to the pull request branch in your clone.
109-
- If any commits have been made by the CI pipeline, pull the changes to your repo (via "Sync fork" button in GUI) before committing any additional changes.
110-
111-
</details>
112-
113-
Finally, when the proposed pull request is accepted, your changes will be integrated in the vocabularies in the folder `vocabularies`.
114-
The vocabularies are stored in split form using one folder per vocabulary.
115-
Each concept, collection and concept scheme is stored in a separate file using the ID-part of the IRI as file name.
116-
117-
See [inbox-excel-vocabs/README.md](https://github.com/nfdi4cat/voc4cat/tree/main/inbox-excel-vocabs/README.md) for a minimal example how to test the submission process.
118-
11986
## How to suggest improvements to the tooling & template?
12087

12188
To discuss about the workflow for maintaining SKOS vocabularies based on this template, create an [voc4cat-template issue](https://github.com/nfdi4cat/voc4cat-template/issues).

docs/docs_usage/how-to-contribute.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ From the root directory of your cloned repo:
151151

152152
2. Sync your fork with upstream nfdi4cat/voc4cat. Press the green "Sync fork" button which makes your fork/clone an exact copy of upstream `main` again (nfdi4cat/voc4cat). If this fails, see [](#troubleshooting).
153153

154-
:::{dropdown} **Be careful when you "*Sync fork*" in GitHub UI.**
154+
:::{dropdown} Be careful when you "*Sync fork*" in GitHub UI.
155155
:icon: copilot-warning
156156
**It should look like this screenshot.** Your main branch should only be behind the forked repository (not ahead of it).
157157

@@ -242,7 +242,7 @@ The downloaded Excel file consists of seven sheets:
242242

243243
The *Concepts* sheet is where most contributions by users will be made.
244244
Detailed descriptions on how to properly fill these columns can be found
245-
in paragraph 6.6. There are nine columns used in the “*Concepts*” sheet:
245+
in the [guidelines](guidelines.md). There are nine columns used in the “*Concepts*” sheet:
246246

247247
1. **Concept IRI**: Must be a valid URI. This is based on the
248248
Vocabulary URI (Uniform Resource Identifier) and for new
@@ -376,17 +376,21 @@ git push
376376

377377
- Open the GitHub page of your fork `https://github.com/<your_username>/voc4cat` and - if you already created a branch for your contribution - switch to the branch.
378378
- Open the “inbox-excel-vocabs” folder
379-
- Click click on the "*Add file*" then "*Upload files*" to open a file a file submission page.
379+
- Click click on the "*Add file*" then "*Upload files*" to open a file submission page.
380380
- Upload the voc4cat.xlsx file (the file name must be exactly this).
381-
- Commit the uploaded file making sure that you **commit to your feature-branch** (not `main`). If you have to create a new branch, you may change the default name to a more reasonable name describing your contribution in the form `issue###_<short_title>`.
381+
- Commit the uploaded file making sure that you **commit to your feature-branch** (not `main`).
382+
If you have to create a new branch, you may change the default name to a more reasonable name describing your contribution in the form `issue###_<short_title>`.
382383

383384
:::
384385
::::
385386

386387
**Create the pull request**
387388

388-
The easiest way is go to the original [nfdi4cat/voc4cat](https://github.com/nfdi4cat/voc4cat) repository.
389-
A notification will show up (1st screenshot) and if you click "Compare & pull request" the defaults will be correct (2nd screenshot).
389+
The easiest way is go to the original [nfdi4cat/voc4cat](https://github.com/nfdi4cat/voc4cat) repository.
390+
A notification will show up (1st screenshot).
391+
After clicking on "Compare & pull request" you will be asked about the source and target of your PR.
392+
Verify that the defaults are correct (2nd screenshot).
393+
If the selection box on the left does not show the upstream voc4cat repository, click on the "compare across forks" link to switch the view.
390394

391395
```{figure} media/create-pr-msg.png
392396
:alt: Screenshot of GitHub UI suggesting to create a PR from your fork
@@ -397,7 +401,7 @@ Vocabulary contribution workflow & Continuous Integration (CI) Pipeline
397401
```{figure} media/selecting-source-and-target-branch-for-pr.png
398402
:alt: Screenshot of GitHub UI with the correct selection of source and target branch for your PR
399403
400-
Check that the source is your feature branach and the target is `nfdi4cat/voc4cat`
404+
Check that the source is your feature branch and the target is `nfdi4cat/voc4cat`
401405
```
402406

403407
Here are some points to check before you finally submit the PR:

0 commit comments

Comments
 (0)