Skip to content

Commit ab22281

Browse files
author
Ware, Joseph (DLSLtd,RAL,LSCI)
committed
Merge commit '92dc82c55ef115ced132c2e43610f5c89aad6da1' into debug-services
2 parents 5545f3e + 92dc82c commit ab22281

File tree

14 files changed

+58
-26
lines changed

14 files changed

+58
-26
lines changed

.github/actions/install_requirements/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ runs:
1515
run: |
1616
PYTHON_VERSION="${{ inputs.python-version }}"
1717
if [ $PYTHON_VERSION == "dev" ]; then
18-
PYTHON_VERSION=$(sed -n "s/ARG PYTHON_VERSION=//p" Dockerfile)
18+
# python version from Dockerfile, removing potential pinned sha
19+
PYTHON_VERSION=$(sed -Ene "s/ARG PYTHON_VERSION=([0-9\.]+).*/\1/p" Dockerfile)
1920
fi
2021
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
2122
shell: bash

.github/workflows/_container.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
on:
22
workflow_call:
3+
inputs:
4+
publish:
5+
type: boolean
6+
description: If true, pushes image to container registry
37

48
jobs:
59
build:
@@ -67,7 +71,7 @@ jobs:
6771
tags: ${{ steps.debug-meta.outputs.tags }}
6872

6973
- name: Push cached image to container registry
70-
if: github.ref_type == 'tag'
74+
if: inputs.publish && github.ref_type == 'tag'
7175
uses: docker/build-push-action@v6
7276
env:
7377
DOCKER_BUILD_RECORD_UPLOAD: false

.github/workflows/_docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
on:
22
workflow_call:
33

4+
45
jobs:
56
build:
67
runs-on: ubuntu-latest

.github/workflows/_example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616

1717
- name: Regenerate example
1818
run: |
19-
pipx run copier copy --data-file example-answers.yml --trust --vcs-ref=HEAD . example
19+
pipx run copier copy --data-file example-answers.yml --vcs-ref=HEAD . example
2020
2121
- name: Rewrite copier answers
2222
run: |
23-
sed -i 's|_src_path: .|_src_path: gh:DiamondLightSource/python-copier-template|' example/.copier-answers.yml
23+
sed -i 's|_src_path: .|_src_path: https://github.com/DiamondLightSource/python-copier-template.git|' example/.copier-answers.yml
2424
2525
- name: Publish example
2626
# We pin to the SHA, not the tag, for security reasons.

.github/workflows/_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Create GitHub Release
2424
# We pin to the SHA, not the tag, for security reasons.
2525
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
26-
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
26+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
2727
with:
2828
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
2929
files: "*"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
3636

3737
release:
38+
needs: [test, docs]
3839
if: github.ref_type == 'tag'
39-
needs: docs
4040
uses: ./.github/workflows/_release.yml
4141
permissions:
4242
contents: write

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ Visit <https://dev-portal.diamond.ac.uk/create> and you will see a list of templ
4646
You will need to `pip install copier` inside an activated `venv` from python3.11 or later, then you can create a new module via:
4747

4848
```
49-
mkdir /path/to/my-project
50-
# The --trust argument is required to run setup tasks such as initializing a git repository
51-
copier copy --trust gh:DiamondLightSource/python-copier-template /path/to/my-project
49+
git init --initial-branch=main /path/to/my-project
50+
# $_ resolves to /path/to/my-project
51+
copier copy https://github.com/DiamondLightSource/python-copier-template.git $_
5252
```
5353

5454
You can also use it via `pipx run copier` if you have that installed.

copier.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ sphinx:
156156

157157
_subdirectory: "template"
158158

159-
_tasks:
160-
- "git init --initial-branch=main"
161-
162159
_migrations:
163160
- version: 2.0.0
164161
before:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 21. Use long-form URLs in documentation
2+
3+
Date: 2025-05-07
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
Copier supports shortcut URLs (see [docs](https://copier.readthedocs.io/en/stable/generating)) of the form `gh:namespace/project`. This was convenient for making our documentation look neater and more digestible to new users, however it is just a convention. When trying to integrate other tools with copier we find that they do not necessarily support the convention. See [this discussion](https://github.com/renovatebot/renovate/discussions/35577) for example.
12+
13+
## Decision
14+
15+
Remove shortcut URLs from this repository and replace them with standard URLs.
16+
17+
## Consequences
18+
19+
Downstream projects following the documentation will be created with standard URLs and will be supported by renovate and other tools. The alternative solution is to open PRs to these tools so they too support the shortcuts. It was decided that it was quicker, easier and probably more architecturally correct to use long-form URLs since they are already a well-known and widely adopted standard. See [this discussion](https://github.com/epics-containers/services-template-helm/issues/21#issuecomment-2855125741).

docs/how-to/update-template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
To track changes to the upstream template, run
66

77
```
8-
copier update --trust
8+
copier update
99
```
1010

1111
This will fetch the latest tagged release of the template, and apply any changes to your working copy. It will prompt for answers again, giving your previous answers as the defaults.
@@ -32,7 +32,7 @@ The following steps are recommended to update your project, especially for infre
3232
- fix issues found by the above
3333
- commit the changes
3434
- update the template
35-
- `copier update --trust`
35+
- `copier update`
3636
- fix any merge conflicts
3737
- validate that the project still works
3838
- `tox -p`

0 commit comments

Comments
 (0)