forgejo/models/gitea_migrations/fixtures/Test_ChangeMavenArtifactConcatenation/package_version.yml
pat-s c39a4368af refactor: migrate from lib/pq to jackc/pgx (#10219)
This PR migrates the unmaintaiend `lib/pq` library to `jackc/pgx`, which is the de-facto standard lib in go for postgres connections these days.

Some implementation notes:

We register both `pgx` and `postgresschema` driver names (for backward comp). We can't register `postgres` as this one is still used by `lib/pq` imported by `go-chi/session`, which is in use when users go for the "postgres" session type in the "Session config.
It is questionable if anyone is really using the "postgres" driver option in the session config - but for consistency, it would be good to also migrate to `pgx` there, especially as the code lives within Forgejo under [go-chi/session](https://code.forgejo.org/go-chi/session).

`pgx` supports multi-host notation in the connection string. New tests have been added therefore.

`pgx` also allows for connection string parameters such as `?default_query_exec_mode=simple_protocol`. This should possibly allow running with `pgbouncer` "transaction" mode instead of "session", which could substantially enhance Postgres query handling.

## Checklist

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10219
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-11-30 17:47:45 +01:00

281 lines
9 KiB
YAML

- id: 1
package_id: 1
creator_id: 1
version: 1.0-SNAPSHOT
lower_version: 1.0-snapshot
created_unix: 1746256357
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 2
package_id: 2
creator_id: 1
version: 1.0-SNAPSHOT
lower_version: 1.0-snapshot
created_unix: 1746256358
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 3
package_id: 1
creator_id: 1
version: 7.0.0
lower_version: 7.0.0
created_unix: 1746256360
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 4
package_id: 2
creator_id: 1
version: 7.0.0
lower_version: 7.0.0
created_unix: 1746256361
is_internal: false
metadata_json: '{"artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 5
package_id: 3
creator_id: 1
version: 7.0.0
lower_version: 7.0.0
created_unix: 1746256364
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 6
package_id: 4
creator_id: 1
version: 7.0.0
lower_version: 7.0.0
created_unix: 1746256365
is_internal: false
metadata_json: '{"artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 7
package_id: 5
creator_id: 1
version: 1.0-SNAPSHOT
lower_version: 1.0-snapshot
created_unix: 1746256367
is_internal: false
metadata_json: '{"group_id":"foo","artifact_id":"-bar","name":"Example :: Parent "}'
download_count: 0
- id: 8
package_id: 5
creator_id: 1
version: 7.0.0
lower_version: 7.0.0
created_unix: 1746256370
is_internal: false
metadata_json: '{"group_id":"foo","artifact_id":"-bar","name":"Example :: Parent "}'
download_count: 0
- id: 9
package_id: 1
creator_id: 1
version: 8.0.0
lower_version: 8.0.0
created_unix: 1746256389
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 10
package_id: 2
creator_id: 1
version: 8.0.0
lower_version: 8.0.0
created_unix: 1746256390
is_internal: false
metadata_json: '{"artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 11
package_id: 3
creator_id: 1
version: 8.0.0
lower_version: 8.0.0
created_unix: 1746256393
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 12
package_id: 4
creator_id: 1
version: 8.0.0
lower_version: 8.0.0
created_unix: 1746256394
is_internal: false
metadata_json: '{"artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 13
package_id: 5
creator_id: 1
version: 8.0.0
lower_version: 8.0.0
created_unix: 1746256399
is_internal: false
metadata_json: '{"group_id":"foo","artifact_id":"-bar","name":"Example :: Parent "}'
download_count: 0
- id: 14
package_id: 1
creator_id: 1
version: 9.0.0
lower_version: 9.0.0
created_unix: 1746256419
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 15
package_id: 2
creator_id: 1
version: 9.0.0
lower_version: 9.0.0
created_unix: 1746256420
is_internal: false
metadata_json: '{"artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 16
package_id: 3
creator_id: 1
version: 9.0.0
lower_version: 9.0.0
created_unix: 1746256423
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 17
package_id: 4
creator_id: 1
version: 9.0.0
lower_version: 9.0.0
created_unix: 1746256424
is_internal: false
metadata_json: '{"artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 18
package_id: 5
creator_id: 1
version: 9.0.0
lower_version: 9.0.0
created_unix: 1746256429
is_internal: false
metadata_json: '{"group_id":"foo","artifact_id":"-bar","name":"Example :: Parent "}'
download_count: 0
- id: 19
package_id: 1
creator_id: 1
version: 10.0.0
lower_version: 10.0.0
created_unix: 1746256449
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 20
package_id: 2
creator_id: 1
version: 10.0.0
lower_version: 10.0.0
created_unix: 1746256450
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 21
package_id: 3
creator_id: 1
version: 10.0.0
lower_version: 10.0.0
created_unix: 1746256452
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 22
package_id: 4
creator_id: 1
version: 10.0.0
lower_version: 10.0.0
created_unix: 1746256453
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 23
package_id: 5
creator_id: 1
version: 10.0.0
lower_version: 10.0.0
created_unix: 1746256459
is_internal: false
metadata_json: '{"group_id":"foo","artifact_id":"-bar","name":"Example :: Parent "}'
download_count: 0
- id: 24
package_id: 1
creator_id: 1
version: 11.0.0
lower_version: 11.0.0
created_unix: 1746256478
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 25
package_id: 2
creator_id: 1
version: 11.0.0
lower_version: 11.0.0
created_unix: 1746256479
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 26
package_id: 3
creator_id: 1
version: 11.0.0
lower_version: 11.0.0
created_unix: 1746256482
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"parent-project","name":"Example :: Parent "}'
download_count: 0
- id: 27
package_id: 4
creator_id: 1
version: 11.0.0
lower_version: 11.0.0
created_unix: 1746256483
is_internal: false
metadata_json: '{"group_id":"com.example","artifact_id":"sub-module","name":"Example :: SubModule ","dependencies":[{"group_id":"junit","artifact_id":"junit","version":"3.8.1"}]}'
download_count: 0
- id: 28
package_id: 5
creator_id: 1
version: 11.0.0
lower_version: 11.0.0
created_unix: 1746256488
is_internal: false
metadata_json: '{"group_id":"foo","artifact_id":"-bar","name":"Example :: Parent "}'
download_count: 0
# broken uploads
- id: 29
package_id: 7
creator_id: 6
version: 1.2.4
lower_version: 1.2.4
created_unix: 1746256488
is_internal: false
metadata_json: '{"group_id":"com.broken","artifact_id":"br-root","name":"Foo"}'
download_count: 0
- id: 30
package_id: 6
creator_id: 6
version: 1.2.4
lower_version: 1.2.4
created_unix: 1746256488
is_internal: false
metadata_json: '{"artifact_id":"br-rest-webmvc","name":"Foo :: REST :: Web MVC","dependencies":[{"group_id":"com.broken","artifact_id":"br-base"},{"group_id":"jakarta.servlet","artifact_id":"jakarta.servlet-api"},{"group_id":"jakarta.validation","artifact_id":"jakarta.validation-api"},{"group_id":"org.springframework","artifact_id":"spring-webmvc"},{"group_id":"org.springframework.hateoas","artifact_id":"spring-hateoas"},{"group_id":"org.springframework.boot","artifact_id":"spring-boot-starter-test"},{"group_id":"com.broken","artifact_id":"br-test"},{"group_id":"com.broken","artifact_id":"br-repo-in-memory"},{"group_id":"org.hibernate.validator","artifact_id":"hibernate-validator"},{"group_id":"org.glassfish.expressly","artifact_id":"expressly"}]}'
download_count: 0
# collision
- id: 31
package_id: 8
creator_id: 1
version: 11.0.0
lower_version: 11.0.0
created_unix: 1746256488
is_internal: false
metadata_json: '{"group_id":"group-bar","artifact_id":"art","name":"Example :: Parent "}'
download_count: 0