spetz commented on code in PR #4714:
URL: https://github.com/apache/iggy/pull/4714#discussion_r4456457309
##########
foreign/swift/README.md:
##########
@@ -544,3 +544,15 @@ for package in examples/swift/getting-started
bdd/swift/tests; do
swift format lint --strict --recursive --configuration
foreign/swift/.swift-format "$package/Sources" "$package/Package.swift"
done
```
+
+### Releasing
+
+`IggyVersion.sdkVersion` in `Sources/Iggy/Iggy.swift` is the SDK version.
Change it only with `scripts/bump-version.sh sdk-swift` from the repository
root, which also regenerates the golden vectors that embed it: `--edge` for the
next development snapshot, `--strip-edge` for the version that goes to a
release vote.
Review Comment:
Documented `--patch --edge` for the first snapshot after a stable release
(`foreign/swift/README.md:555`).
##########
scripts/bump-version.sh:
##########
@@ -563,6 +589,19 @@ cmd_bump() {
echo -e "${CYAN}New:${NC} ${new_ver}"
echo ""
+ local swift_backup=""
+ if [[ "$component" == "sdk-swift" && $apply -eq 1 ]]; then
Review Comment:
Fixed. The cargo check runs before the version loop in both modes
(`scripts/bump-version.sh:578`), and a dry run now lists `golden.json` and puts
it in the `git add` hint (`scripts/bump-version.sh:611`).
##########
scripts/bump-version.sh:
##########
@@ -589,6 +628,20 @@ cmd_bump() {
fi
done < <(get_version_files "$component")
+ if [[ -n "$swift_backup" ]]; then
+ if [[ ${#changed_files[@]} -gt 0 ]]; then
+ echo " Regenerating ${SWIFT_GOLDEN_FIXTURE}"
+ if ! regenerate_swift_golden; then
Review Comment:
Fixed. An INT and TERM trap around the generator restores `Iggy.swift` and
exits 130 (`scripts/bump-version.sh:614`). With the simplification in the other
thread there are no temp files left to remove. SIGINT and SIGTERM sent while
`cargo run` compiled the generator both left `Iggy.swift` and `golden.json`
byte-identical.
##########
scripts/bump-version.sh:
##########
@@ -563,6 +589,19 @@ cmd_bump() {
echo -e "${CYAN}New:${NC} ${new_ver}"
echo ""
+ local swift_backup=""
Review Comment:
Done. The backup and the temp fixture are gone, the generator writes
`golden.json` directly, and a failure restores the version with `write_version`
(`scripts/bump-version.sh:617`). The generator writes the file once, after it
built every vector, so a failed run leaves the old fixture in place. A forced
generator failure exits 1 with both files byte-identical.
##########
.github/actions/swift/pre-merge/action.yml:
##########
@@ -45,6 +45,37 @@ runs:
for package in examples/swift/getting-started bdd/swift/tests; do
swift format lint --strict --recursive --configuration
foreign/swift/.swift-format "$package/Sources" "$package/Package.swift"
done
+ swift format lint --strict --configuration foreign/swift/.swift-format
Package.swift
+
+ # Consumers and CI must build the same library from the two manifests.
+ - name: Check the root manifest matches the SDK manifest
+ shell: bash
+ if: inputs.task == 'lint'
+ run: |
+ set -euo pipefail
+ root_manifest=$(swift package --package-path . dump-package)
+ sdk_manifest=$(swift package --package-path foreign/swift dump-package)
+ if ! jq -e '.products | length == 1 and .[0].name == "Iggy"' <<<
"$root_manifest" >/dev/null \
Review Comment:
Done (`.github/actions/swift/pre-merge/action.yml:57`). Each side maps its
expected `Iggy` path to one sentinel and a single `diff` compares them. The old
and the new step agree on the real manifests and on 11 mutations, among them an
extra root product or target, a moved path on either side, a dependency bound,
a platform, localization, tools version and language mode.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]