fix(export): resolve agent register/schema by slug, not hardcoded numeric id - #258
Merged
Merged
Conversation
…eric id FlowAndAgentExportBundler::bundleAgents() filtered agents by two hardcoded numeric class constants (register 206, schema 5060) — this dev instance's auto-increment ids for openbuild/agent, which are not stable across a fresh install. On any instance whose ids differ, the filter silently matches zero agents: no exception, no skip record, just an export that "succeeded" having bundled nothing. Confirmed live today: app-repo-format-flow-agent-export (#255) wired this same method into the buildiq-* GitHub round trip, and its live test on a fresh instance hit exactly this failure mode. Replace the numeric ids with the slugs 'openbuild'/'agent', mirroring the pattern already used by AgentsController, ObjectSchemaSlugResolver, and AppChannelApplier::credentialExists() — ObjectService::findAll() already resolves a string filter value through RegisterMapper/SchemaMapper, which support slug lookup, register-scoped. Live-verified on a fresh isolated instance (register openbuild=16, schema agent=115 — neither matches the old hardcoded values): reverting to the old constants reproduced the silent-zero-agents bug on that instance, restoring the fix bundled the agent again.
Contributor
Quality Report — ConductionNL/openbuild @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| test-l10n | ✅ | ||||
| check-gitignore | ✅ | ||||
| check-nc-floor | ✅ | ||||
| format | ✅ | ||||
| composer | ✅ | ✅ 106/106 | |||
| npm | ✅ | ✅ 626/626 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ❌ | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-08-19 09:14 UTC
Download the full PDF report from the workflow artifacts.
Contributor
Quality Report — ConductionNL/openbuild @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| test-l10n | ✅ | ||||
| check-gitignore | ✅ | ||||
| check-nc-floor | ✅ | ||||
| format | ✅ | ||||
| composer | ✅ | ✅ 106/106 | |||
| npm | ✅ | ✅ 626/626 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-08-19 10:25 UTC
Download the full PDF report from the workflow artifacts.
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.
Summary
FlowAndAgentExportBundler::bundleAgents()filtered agents by two hardcodednumeric class constants —
OPENBUILD_REGISTER = 206,AGENT_SCHEMA = 5060,this dev instance's auto-increment ids for the
openbuildregister andagentschema. Those ids are not stable across a fresh install: on anyinstance where they land differently, the
findAll()filter silentlymatches zero rows — no exception, no skip record, just an export that
reports
succeededhaving bundled nothing.This was confirmed live today:
app-repo-format-flow-agent-export(#255,merged today) wired this same method into the buildiq-* GitHub round trip,
and its live round-trip test on a fresh instance hit exactly this failure
mode.
'openbuild'/'agent',mirroring the pattern already used by
AgentsController,ObjectSchemaSlugResolver, andAppChannelApplier::credentialExists().ObjectService::findAll()already resolves a string filter value throughRegisterMapper/SchemaMapper, which support slug lookup — no newcollaborator, no constructor change, no call-site change beyond the two
constants.
FlowAndAgentExportBundlerTestto assert thefindAll()filternow carries the slugs, guarding this exact regression.
bundleFlows()(already UUID-based) and every caller(
AppRepoSerializer/AppChannelApplier/FlowAgentChannelCollector) areuntouched — both of OpenBuild's export systems share this method and both
inherit the fix.
bundle-agents-slug-not-numeric-id, archived, folded a newrequirement into the
openbuild-exportercanonical spec.Live verification (not just unit tests)
Spun up an isolated docker-compose instance (project
g19bai, its owncontainers/ports/volumes, torn down afterward —
docker psbefore/after isidentical, no other session's containers touched) with openregister +
openconnector + openbuild (this branch) + hermiq. Created a test
Application + Agent, then ran the full round trip including a negative
control:
openbuild=16,agent=115 (a second, unrelatedagentschema id=87 also exists on this instance — schema slugs are not globally unique, confirming the register-scoped resolution matters)206/5060(neither id exists on this instance)succeeded, zero agent files in the ZIP — the exact silent-failure mode from the bug report, reproduced liveTest plan
FlowAndAgentExportBundlerTest: 6/6 green, including the newslug-filter assertion
ZipArchive-missing errors unrelated to this change (host PHP has nozip extension; reproduced identically against the unmodified
apps-extra/openbuildcheckout)phpcs/phpmd/phpstan/psalmclean on the changed file (the file'sone pre-existing PHPCS warning is unchanged before/after this diff)
negative control above