Skip to content

Feat: PEN-0000 Move api-deploy, remove redundant inline schemas - #1

Merged
umaan1982 merged 7 commits into
developfrom
feature/usmansaeed/dedup-external-refs
Jul 30, 2026
Merged

Feat: PEN-0000 Move api-deploy, remove redundant inline schemas#1
umaan1982 merged 7 commits into
developfrom
feature/usmansaeed/dedup-external-refs

Conversation

@umaan1982

@umaan1982 umaan1982 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

feat: dedupe external $refs, add removeExamples

API Gateway's import limit is 6 MiB. Every external $ref was inlined as a full copy at each use site — ~1,100 copies of six shared error schemas — pushing packaging's compiled spec over it.

Two opt-in options, both default false (existing configs compile unchanged):

  • flatten.dedupExternalRefs — resolve each external schema once into components/schemas, reference it internally. API Gateway resolves internal refs.
  • gateway.removeExamples — strip example/examples.

Packaging spec: 6,355,686 B → 3,916,374 B.

Also: moved the fork to Packmatic — docker.yml now publishes ghcr.io/packmatic/api-deploy on merge to develop (was Fabian's Docker Hub account), and refreshed tests/openapi/*_target.yml, which had gone stale against api-types 1.11.0 (wider urn.yml pattern, new error-response fields).

Verified lossless: expanding the hoisted refs reproduces the fully-inlined spec with 0 differences. 10 new unit tests. Suite green (17/17).

Comment thread setup.py Outdated
Comment thread .github/workflows/docker.yml Outdated
@mcchrish

Copy link
Copy Markdown
Member

If it's an internal tool now, then we must publish it via our internal package service i.e. AWS image registry.

@umaan1982

Copy link
Copy Markdown
Collaborator Author

If it's an internal tool now, then we must publish it via our internal package service i.e. AWS image registry.

@mcchrish Yeah, possible. I actually started with ECR, but the fork has no AWS secrets available to it and there's no api-deploy ECR repo yet, so nothing could be pushed without an org admin and an infra change first.

I went GHCR to unblock the release since it needs no new repo or secrets.

We can do a follow up to migrate the images to AWS image registry after aug 12 deadline

@mcchrish

Copy link
Copy Markdown
Member

Actually it's ok for it to be public for now. The fork is also public.

@fabfuel fabfuel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

So far, testing heavily relied on function tests wich actual OpenAPI files in and out.
I would create another pair of files that we run with dedup enabled to keep It consistent.

platforms: linux/amd64,linux/arm64
push: true
tags: fabfuel/api-deploy:${{ github.ref_name }}
tags: ghcr.io/packmatic/api-deploy:${{ github.ref_name }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need any permissions setup for this?

@umaan1982 umaan1982 Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses packages:write

@fabfuel fabfuel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👌

@umaan1982
umaan1982 merged commit 5dbe678 into develop Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants