Skip to content

Commit 04e4a2c

Browse files
authored
Merge pull request #175 from dotkernel/upgrade-7.1
regenerated page - upgrade api v6 to v7
2 parents efa1570 + 554b04d commit 04e4a2c

3 files changed

Lines changed: 66 additions & 15 deletions

File tree

‎.claude/skills/upgrade-plan/SKILL.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ Do not create the page, edit `mkdocs.yml` or edit any other file until the user
3333
- titles that disagree with the code, such as a class named differently in the title and the diff
3434
- release-note oddities: a changelog entry missing most pull requests, or dated differently from the release
3535
- which branch the release comes from, since a minor release may come from the previous branch
36-
5. **Scope.** List commits on the release branch after the tag as out of scope and unreleased.
36+
5. **Scope.** Read the last section of the gather output.
37+
If it says the release was superseded, state that later commits belong to the named newer release and point to its plan; list no unreleased commits.
38+
Otherwise list the commits on the release branch after the tag as out of scope and unreleased.
3739
6. **Write the plan** to `.claude/PLAN-UPGRADE-<to>.md`, using the layout below.
3840
7. **Lint and report.**
3941
Run `npx --yes markdownlint-cli2 --config ~/.claude/markdownlint.jsonc ".claude/PLAN-UPGRADE-<to>.md"` and fix every issue.
@@ -71,7 +73,7 @@ Follow `.claude/PLAN-UPGRADE-7.1.md` if it exists, otherwise this order:
7173
3. Findings that shape the page: the headline changes and the step 4 cross-checks.
7274
4. Pull requests: an important table and an optional table with `PR | Description`, each PR as a full URL, most impactful first.
7375
Escape `|` inside table cells as `\|`.
74-
5. Out of scope: unreleased commits.
76+
5. Out of scope: unreleased commits, or a note that the release was superseded and by which one.
7577
6. Page outline: the newest existing `UPGRADE-*.md` is the template, with the same headings, one sentence per line and the same bullet marker.
7678
Details has `### Important updates` and `### Optional updates`, and the FAQ covers PHP versions, migrations, moved config, and whether optional updates are required.
7779
7. Files to change on execution: the new page, the nav entry in `mkdocs.yml` (newest first), and `upgrading.md` only if it links the other version pages.

‎.claude/skills/upgrade-plan/gather.sh‎

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,28 @@ while read -r pr; do
3838
-q '"### #\(.number) \(.title)\n- merged: \(.mergedAt)\n- files: \([.files[].path] | join(", "))\n"'
3939
done
4040

41-
echo "## Commits on branch $BRANCH after tag $TO (unreleased)"
42-
gh api "repos/$REPO/compare/$TO...$BRANCH" \
43-
--jq '"- ahead: \(.ahead_by)", (.commits[] | "- \(.sha[0:7]) \(.commit.message | split("\n")[0])")' 2>/dev/null ||
44-
echo "- (branch $BRANCH not comparable)"
41+
# Earliest non-draft, non-prerelease release on the same branch published after $TO.
42+
# `gh release list` does not expose the target branch, so look it up per candidate.
43+
TO_PUBLISHED="$(gh release view "$TO" -R "$REPO" --json publishedAt -q .publishedAt)"
44+
NEXT=""
45+
while read -r candidate; do
46+
[ -n "$candidate" ] || continue
47+
candidate_branch="$(gh release view "$candidate" -R "$REPO" --json targetCommitish -q .targetCommitish)"
48+
if [ "$candidate_branch" = "$BRANCH" ]; then
49+
NEXT="$candidate"
50+
break
51+
fi
52+
done < <(gh release list -R "$REPO" --limit 100 --json tagName,publishedAt,isDraft,isPrerelease \
53+
-q "[.[] | select(.isDraft == false and .isPrerelease == false and .publishedAt > \"$TO_PUBLISHED\")] | sort_by(.publishedAt) | .[].tagName")
54+
55+
if [ -n "$NEXT" ]; then
56+
echo "## Commits after tag $TO"
57+
echo "- superseded by release $NEXT on branch $BRANCH: later commits belong to $NEXT or newer, so none are listed as unreleased"
58+
NEXT_COUNT="$(gh api "repos/$REPO/compare/$TO...$NEXT" --jq .ahead_by 2>/dev/null || echo "?")"
59+
echo "- commits between $TO and $NEXT: $NEXT_COUNT"
60+
else
61+
echo "## Commits on branch $BRANCH after tag $TO (unreleased)"
62+
gh api "repos/$REPO/compare/$TO...$BRANCH" \
63+
--jq '"- ahead: \(.ahead_by)", (.commits[] | "- \(.sha[0:7]) \(.commit.message | split("\n")[0])")' 2>/dev/null ||
64+
echo "- (branch $BRANCH not comparable)"
65+
fi

‎docs/book/v7/upgrading/UPGRADE-7.0.md‎

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,28 @@
33
## Summary
44

55
The changes you need to port into your project when moving from Dotkernel API 6.x to 7.0, each linked to the pull request that introduced it.
6-
The headline items are native UUIDs in the database, PostgreSQL support, and the removal of the `MethodDeprecation` implementation.
6+
The headline items are native UUIDs in the database, PostgreSQL support with renamed database connection keys, and the removal of the `MethodDeprecation` implementation.
7+
Version 7.0 does not change the PHP version or any Composer dependency constraint.
78

89
## Details
910

10-
> You can find a complete list in [Changelog](https://github.com/dotkernel/api/blob/7.0/CHANGELOG.md)
11+
> You can find the release notes in [7.0.0](https://github.com/dotkernel/api/releases/tag/7.0.0) and a complete list in [Changelog](https://github.com/dotkernel/api/blob/7.0/CHANGELOG.md)
12+
13+
### Important updates
14+
15+
These changes affect your database schema, configuration, entities or runtime behavior.
16+
17+
* Use native UUIDs in database via `ramsey/uuid`: entities get their identifier from the new `UuidIdentifierTrait` and a `UuidType` that declares the SQL type `UUID`. `getUuid()` becomes `getId()` and the `uuid` key becomes `id` in entities, repositories, services, input filters and OpenAPI. A schema migration is required [https://github.com/dotkernel/api/pull/456](https://github.com/dotkernel/api/pull/456)
18+
* PostgreSQL implementation: in `config/autoload/local.php.dist` the `default` connection is renamed `mariadb`, a `postgresql` connection is added, and `charset` and `collate` are replaced by `collation`. `AbstractEnumType` is reworked, `MigrationsMigratedSubscriber` is added and `config/cli-config.php` is updated [https://github.com/dotkernel/api/pull/462](https://github.com/dotkernel/api/pull/462)
19+
* Remove `MethodDeprecation` implementation: the attribute and its tests are deleted, and `DeprecationMiddleware` and the error-report handler no longer use it [https://github.com/dotkernel/api/pull/470](https://github.com/dotkernel/api/pull/470)
20+
21+
### Optional updates
22+
23+
These changes cover documentation and comments.
24+
Skipping them does not affect how the API runs.
1125

12-
* Use native UUIDs in database via `ramsey/uuid` [https://github.com/dotkernel/api/pull/456](https://github.com/dotkernel/api/pull/456)
13-
* updated readme, oss [https://github.com/dotkernel/api/pull/461](https://github.com/dotkernel/api/pull/461)
14-
* PostgreSQL implementation [https://github.com/dotkernel/api/pull/462](https://github.com/dotkernel/api/pull/462)
15-
* Remove `MethodDeprecation` implementation [https://github.com/dotkernel/api/pull/470](https://github.com/dotkernel/api/pull/470)
1626
* Clarify instructions regarding multiple connections in `config/autoload/local.php.dist` [https://github.com/dotkernel/api/pull/472](https://github.com/dotkernel/api/pull/472)
27+
* Update readme and security documents [https://github.com/dotkernel/api/pull/461](https://github.com/dotkernel/api/pull/461)
1728

1829
## FAQ
1930

@@ -23,20 +34,37 @@ A: No.
2334
You implement each listed change manually in your own project.
2435
See [Upgrades](upgrading.md) for the recommended procedure.
2536

37+
**Q: Do I need to change my PHP version or dependencies?**
38+
39+
A: No.
40+
The PHP constraint and the Composer dependencies are the same in 6.1.0 and 7.0.0.
41+
42+
**Q: Which code or configuration do I need to rename?**
43+
44+
A: Rename `getUuid()` to `getId()` and the `uuid` key to `id` wherever your own code uses them.
45+
In your `config/autoload/local.php`, rename the `default` database connection to `mariadb` and replace `charset` and `collate` with `collation`.
46+
Compare your file with `local.php.dist` from the 7.0 branch.
47+
2648
**Q: What does the switch to native UUIDs mean for my database?**
2749

28-
A: Identifiers are stored using the database's own UUID handling via `ramsey/uuid` rather than a generic column type, so existing tables need a migration.
50+
A: The identifier column type changes from `uuid_binary` to the database's `UUID` type, through a `UuidType` that extends the `ramsey/uuid-doctrine` type.
51+
The release does not ship a migration file, so existing tables need a migration that you write for your own schema.
2952
Review pull request 456 before touching production data.
3053

3154
**Q: Do I have to move to PostgreSQL in 7.0?**
3255

3356
A: No.
34-
PostgreSQL is now supported in addition to MariaDB; either is a valid choice.
57+
PostgreSQL is now supported in addition to MariaDB; either is a valid choice, and MariaDB remains the default connection.
3558

3659
**Q: `MethodDeprecation` was removed — how do I deprecate an endpoint now?**
3760

3861
A: Use the deprecation approach described in [API evolution](../tutorials/api-evolution.md).
3962

63+
**Q: Do I have to apply the optional updates?**
64+
65+
A: No.
66+
They only concern documentation and comments.
67+
4068
**Q: Where do I find the complete list of changes?**
4169

42-
A: In the project [CHANGELOG.md](https://github.com/dotkernel/api/blob/7.0/CHANGELOG.md).
70+
A: In the [7.0.0 release notes](https://github.com/dotkernel/api/releases/tag/7.0.0) and the project [CHANGELOG.md](https://github.com/dotkernel/api/blob/7.0/CHANGELOG.md).

0 commit comments

Comments
 (0)