Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I506 #2

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2aa4742
typo fix
Avinesh Mar 6, 2024
0f50a62
trivial: Prepare for ruff bump
stephenfin Apr 8, 2024
ffbd322
pre-commit: Bump versions
stephenfin Apr 8, 2024
3e5bb7e
docker: Make .env file optional
stephenfin Jul 12, 2024
47add6b
requirements: Bump various libraries
stephenfin Jul 12, 2024
b648ba0
Remove unused import
stephenfin Jul 12, 2024
33b209d
build(deps): update psycopg2 requirement from ~=2.9.0 to ~=2.9.9
dependabot[bot] Jul 12, 2024
1921a9b
build(deps): update django requirement from ~=5.0.0 to ~=5.0.7
dependabot[bot] Jul 12, 2024
e879cda
build(deps): update psycopg2-binary requirement from ~=2.9.0 to ~=2.9.9
dependabot[bot] Jul 12, 2024
4ec9033
pre-commit: Everything in Python 3 now
stephenfin Jul 12, 2024
c6fa6e7
build(deps): update openapi-core requirement from ~=0.19.0 to ~=0.19.2
dependabot[bot] Jul 15, 2024
955e80c
build(deps): update mysqlclient requirement from ~=2.2.0 to ~=2.2.4
dependabot[bot] Jul 15, 2024
77b2060
build(deps-dev): update django-debug-toolbar requirement
dependabot[bot] Jul 15, 2024
4dfe699
build(deps): update sqlparse requirement from ~=0.5.0 to ~=0.5.1
dependabot[bot] Jul 22, 2024
af477a9
CI: docker-compose -> docker compose
stephenfin Oct 23, 2024
009dc90
pre-commit: Bump versions
stephenfin Oct 23, 2024
18e91c4
Drop Python 3.8 support
stephenfin Oct 23, 2024
5e2f3b8
requirements: Bump Django to 5.1.x, django-filter to 24.3.0
stephenfin Oct 23, 2024
80d5962
Add Python 3.13 support
stephenfin Oct 23, 2024
8242e9d
requirements: Bump versions
stephenfin Oct 23, 2024
9d2eaff
docker-compose: Remove version
stephenfin Oct 23, 2024
bbcefad
dependabot: Ignore (most) patch update
stephenfin Oct 23, 2024
b8856bb
dependabot: Manage GitHub Action workflows also
stephenfin Oct 23, 2024
fe7a277
docs: Update release note to reflect timelines
stephenfin Oct 23, 2024
1d5c436
Release 3.2.0
stephenfin Oct 23, 2024
8d204c0
Post-release version bump
stephenfin Oct 23, 2024
e2c37f1
Update reno for stable/3.2
stephenfin Oct 23, 2024
51581fa
docs: Fix typo
stephenfin Oct 23, 2024
7643453
CI: Bump action versions
stephenfin Oct 23, 2024
13bbc0d
templates/submission: Fix alignment of commit message
tmonjalo Aug 16, 2024
09939ba
CI: Cancel builds upon a new push
stephenfin Oct 31, 2024
fa14cf8
tests: Dump more info if version test fails
stephenfin Oct 31, 2024
c443cd9
css: make diff colors more accessible
rjarry Oct 5, 2022
801e5bd
models: Add covering index for Patch.hash
stephenfin Jan 24, 2024
45f47e9
views: Switch logout to POST
stephenfin Nov 1, 2024
6203264
views: Don't show chevron if user can't change sort order
stephenfin Nov 1, 2024
09613eb
views: Clean up patch-list page
raxelg Aug 23, 2021
0cea2e4
views: Move js code to separate file
raxelg Aug 23, 2021
17726d7
views: Move and refactor patch-forms
raxelg Aug 23, 2021
8c7aed3
views: Style modification forms as an action bar
raxelg Aug 23, 2021
a2cac80
models: Add 'related_series' field to Series model
andrepapoti Mar 18, 2024
6e3d250
serializers: Add 'related_versions' field to series serializer
andrepapoti Mar 18, 2024
14078c5
serializers: Optimize query performance on SeriesMixin for 'related_s…
andrepapoti Mar 18, 2024
e9c5545
urls: Create endpoint to link two series
andrepapoti Mar 18, 2024
2ea356c
tests: Add tests for linking series feature
andrepapoti Mar 18, 2024
a91a667
release-notes: Add release notes for the Series linking feature
andrepapoti Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
---
version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
versioning-strategy: "increase"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
51 changes: 27 additions & 24 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ name: CI
on:
- push
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install dependencies
Expand All @@ -29,7 +32,7 @@ jobs:
matrix:
# NOTE: If you add a version here, don't forget to update the
# '[gh-actions]' section in tox.ini
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
db: [postgres, mysql, sqlite3]
env:
DATABASE_TYPE: "${{ matrix.db }}"
Expand Down Expand Up @@ -68,9 +71,9 @@ jobs:
--health-retries 5
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
Expand Down Expand Up @@ -99,19 +102,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: python -m pip install tox
- name: Build docs (via tox)
run: tox -e docs
- name: Archive build results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-docs-build
path: docs/_build/html
Expand All @@ -126,39 +129,39 @@ jobs:
COMPOSE_FILE: ${{ matrix.db == 'mysql' && 'docker-compose.yml' || (matrix.db == 'postgres' && 'docker-compose-pg.yml') || 'docker-compose-sqlite3.yml' }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Build docker-compose service
run: |
docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g)
docker compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g)
- name: Test createsuperuser/changepassword
run: |
docker-compose run -T --rm web \
docker compose run -T --rm web \
python manage.py createsuperuser \
--username patchwork --no-input --email [email protected]
{ echo patchwork; echo patchwork; } | \
docker-compose run -T --rm web \
docker compose run -T --rm web \
python manage.py changepassword patchwork
# FIXME(stephenfin): Re-enable this once dbbackup supports Django 4.0
# - name: Test dbbackup/dbrestore
# run: |
# docker-compose run -T --rm web python manage.py dbbackup
# echo y | docker-compose run -T --rm web python manage.py dbrestore
# docker compose run -T --rm web python manage.py dbbackup
# echo y | docker compose run -T --rm web python manage.py dbrestore
- name: Modify database user permissions (mysql)
if: ${{ matrix.db == 'mysql' }}
run: |
docker-compose exec -T -- db \
docker compose exec -T -- db \
sh -c "exec mysql -uroot -p\"\${MYSQL_ROOT_PASSWORD}\" -e \"GRANT ALL ON \\\`test\\_\${MYSQL_DATABASE}%\\\`.* to '\${MYSQL_USER}'@'%'; FLUSH PRIVILEGES;\""
- name: Run unittest
run: docker-compose run -T --rm web tox
run: docker compose run -T --rm web tox
- name: Test normal startup
run: |
docker-compose up --detach
docker compose up --detach

for count in $(seq 50); do \
if curl --fail --silent "http://localhost:8000"; then \
Expand All @@ -168,7 +171,7 @@ jobs:
done
echo

docker-compose ps
docker compose ps
- name: Test client access (git-pw)
run: |
python -m pip install git-pw
Expand All @@ -177,4 +180,4 @@ jobs:
--username patchwork --password patchwork series list
- name: Dump container logs
if: ${{ always() }}
run: docker-compose logs --no-color --timestamps
run: docker compose logs --no-color --timestamps
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
- id: check-merge-conflict
Expand All @@ -14,15 +11,15 @@ repos:
- id: trailing-whitespace
exclude: (.*\.mbox)|(.*\.svg)
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf)
- id: remove-crlf
exclude: (.*\.mbox)|(.*\.svg)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.13
rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
Expand All @@ -33,7 +30,7 @@ repos:
hooks:
- id: bashate
- repo: https://github.com/daveshanley/vacuum
rev: v0.7.2
rev: v0.12.1
hooks:
- id: vacuum
files: ^docs/api/schemas/(latest|v\d\.\d)/patchwork.yaml
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ environment. To install Patchwork:

$ git clone https://github.com/getpatchwork/patchwork.git

3. Create a ``.env`` file in the root directory of the project and store your
``UID`` and ``GID`` attributes there::
3. (Optional) Create a ``.env`` file in the root directory of the project and
store your ``UID`` and ``GID`` attributes there::

$ cd patchwork && printf "UID=$(id -u)\nGID=$(id -g)\n" > .env

This should only be necessary if you have a ``UID`` or ``GID`` other than
``1000``.

4. Build the images. This will download a number of packages from the internet,
and compile several versions of Python::

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-pg.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
---
services:
db:
image: postgres:latest
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-sqlite3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
---
services:
web:
build:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
---
services:
db:
image: mysql:latest
Expand Down
49 changes: 28 additions & 21 deletions docs/api/rest/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This guide provides an overview of how one can interact with the REST API. For
detailed information on type and response format of the various resources
exposed by the API, refer to the web browsable API. This can be found at:

https://patchwork.example.com/api/1.3/
https://patchwork.example.com/api/1.4/

where `patchwork.example.com` refers to the URL of your Patchwork instance.

Expand Down Expand Up @@ -43,6 +43,11 @@ If all you want is reference guides, skip straight to :ref:`rest-api-schemas`.
The API version was bumped to v1.3 in Patchwork v3.1. The older APIs are
still supported. For more information, refer to :ref:`rest-api-versions`.

.. versionchanged:: 3.2

The API version was bumped to v1.4 in Patchwork v3.2. The older APIs are
still supported. For more information, refer to :ref:`rest-api-versions`.

Getting Started
---------------

Expand All @@ -57,16 +62,16 @@ Patchwork instance hosted at `patchwork.example.com`, run:

.. code-block:: shell

$ curl -s 'https://patchwork.example.com/api/1.3/' | python -m json.tool
$ curl -s 'https://patchwork.example.com/api/1.4/' | python -m json.tool
{
"bundles": "https://patchwork.example.com/api/1.3/bundles/",
"covers": "https://patchwork.example.com/api/1.3/covers/",
"events": "https://patchwork.example.com/api/1.3/events/",
"patches": "https://patchwork.example.com/api/1.3/patches/",
"people": "https://patchwork.example.com/api/1.3/people/",
"projects": "https://patchwork.example.com/api/1.3/projects/",
"series": "https://patchwork.example.com/api/1.3/series/",
"users": "https://patchwork.example.com/api/1.3/users/"
"bundles": "https://patchwork.example.com/api/1.4/bundles/",
"covers": "https://patchwork.example.com/api/1.4/covers/",
"events": "https://patchwork.example.com/api/1.4/events/",
"patches": "https://patchwork.example.com/api/1.4/patches/",
"people": "https://patchwork.example.com/api/1.4/people/",
"projects": "https://patchwork.example.com/api/1.4/projects/",
"series": "https://patchwork.example.com/api/1.4/series/",
"users": "https://patchwork.example.com/api/1.4/users/"
}


Expand All @@ -79,17 +84,17 @@ well-supported. To repeat the above example using `requests`:, run
$ python
>>> import json
>>> import requests
>>> r = requests.get('https://patchwork.example.com/api/1.3/')
>>> r = requests.get('https://patchwork.example.com/api/1.4/')
>>> print(json.dumps(r.json(), indent=2))
{
"bundles": "https://patchwork.example.com/api/1.3/bundles/",
"covers": "https://patchwork.example.com/api/1.3/covers/",
"events": "https://patchwork.example.com/api/1.3/events/",
"patches": "https://patchwork.example.com/api/1.3/patches/",
"people": "https://patchwork.example.com/api/1.3/people/",
"projects": "https://patchwork.example.com/api/1.3/projects/",
"series": "https://patchwork.example.com/api/1.3/series/",
"users": "https://patchwork.example.com/api/1.3/users/"
"bundles": "https://patchwork.example.com/api/1.4/bundles/",
"covers": "https://patchwork.example.com/api/1.4/covers/",
"events": "https://patchwork.example.com/api/1.4/events/",
"patches": "https://patchwork.example.com/api/1.4/patches/",
"people": "https://patchwork.example.com/api/1.4/people/",
"projects": "https://patchwork.example.com/api/1.4/projects/",
"series": "https://patchwork.example.com/api/1.4/series/",
"users": "https://patchwork.example.com/api/1.4/users/"
}

Tools like `curl` and libraries like `requests` can be used to build anything
Expand All @@ -108,7 +113,7 @@ Versioning
----------

By default, all requests will receive the latest version of the API: currently
``1.3``:
``1.4``:

.. code-block:: http

Expand All @@ -119,7 +124,7 @@ changes breaking your application:

.. code-block:: http

GET /api/1.3 HTTP/1.1
GET /api/1.4 HTTP/1.1

Older API versions will be deprecated and removed over time. For more
information, refer to :ref:`rest-api-versions`.
Expand Down Expand Up @@ -275,6 +280,7 @@ Supported Versions
1.1, 2.1, ✓
1.2, 2.2, ✓
1.3, 3.1, ✓
1.4, 3.2, ✓

Further information about this and more can typically be found in
:doc:`the release notes </releases/index>`.
Expand All @@ -292,6 +298,7 @@ Auto-generated schema documentation is provided below.
/api/rest/schemas/v1.1
/api/rest/schemas/v1.2
/api/rest/schemas/v1.3
/api/rest/schemas/v1.4

.. Links

Expand Down
4 changes: 2 additions & 2 deletions docs/api/rest/schemas/v1.3.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
API v1.3 (latest)
=================
API v1.3
========

.. openapi:: ../../schemas/v1.3/patchwork.yaml
:examples:
5 changes: 5 additions & 0 deletions docs/api/rest/schemas/v1.4.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API v1.4 (latest)
=================

.. openapi:: ../../schemas/v1.4/patchwork.yaml
:examples:
4 changes: 2 additions & 2 deletions docs/api/schemas/generate-schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
yaml = None

ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), None]
LATEST_VERSION = (1, 3)
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), None]
LATEST_VERSION = (1, 4)


def generate_schemas():
Expand Down
Loading