Skip to content

feat(registry,registry-seed): admit and seed the catalog crawler's publish action - #96

Open
kelvinprabhu wants to merge 5 commits into
release-0.2.0from
feat/77-catalog-crawler-registry-publish-action
Open

kelvinprabhu wants to merge 5 commits into
release-0.2.0from
feat/77-catalog-crawler-registry-publish-action

Conversation

@kelvinprabhu

@kelvinprabhu kelvinprabhu commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #77 · Refs OpenAgriNet/network-adapter#54 · Split from #92

Objective

Let the registry hold, and registry-seed write, the publish action that names the pipeline the network adapter's catalog crawler runs for a binding. Split out of #92 so it can be deployed before the crawler.

Solution

  • registry: publish joins the Action enum, and MappingPath also accepts a <...>/publish/<source>.yaml pipeline URL. Every action still requires method, path and mappings.
  • registry-seed: bindings[].publishPipelineUrl (optional) appends a publish action (POST /publish) beside select; on a binding that already exists the Job adds or repoints that action with a PUT of the whole record.

Nothing reads the action until the crawler runs (#92), so this is safe to deploy on its own.

Verification

  • MappingPath checked against the agmarknet SHA-pinned pipeline URL and existing *.select.yaml / *.discover.yml mappings (match), and .., a bare x.yaml, x.publish.yaml (refused).
  • registry-seed: helm lint passes; a binding with publishPipelineUrl renders and seed.py compiles; the publish helpers tested against a mocked registry (add, already present, repoint, missing row).
  • charts/registry lint fails on development too (templates/deployment.yaml line 82, unrelated).

Quick-start counterpart: #93 (same schema copy).

Not done

  • Not run on a cluster.

…blish action

registry 0.5.0: ProviderSchema accepts a `publish` action whose mapping is an
https <...>/publish/<source>.yaml pipeline URL; select/init/confirm still need
method, path and a mapping folder.

registry-seed 0.2.0: bindings[].publishPipelineUrl adds that action, pinned to
a commit SHA unless allowUnpinnedPipeline is set; on an existing binding the
Job adds or repoints it.

Nothing reads the action until the network adapter's catalog crawler runs, so
this can be deployed ahead of it.

Refs #77
The registry's ProviderSchema already refuses a publish mapping that is not an
https <...>/publish/<source>.yaml, and the Job then fails naming the binding,
so the render-time copy of that regex (and allowUnpinnedPipeline) only
duplicated it. Pinning to a commit SHA stays a documented convention in
values.yaml. The README row repeated the values comment.

Refs #77

@kelvinprabhu kelvinprabhu left a comment

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.

Fix Needed

"description": "How to call this provider for one Beckn action: where, how, and with which mapping. Anything the upstream needs that the Beckn body cannot express is the adapter plugin's work, not a field here. status is per action, so one can be retired without touching the others. Permits additional properties because the registry re-validates the MERGED document on a PUT, and that document carries the osid, osUpdatedAt and osOwner the registry injected itself -- which a strict schema rejects as extraneous. Do not set this back to false without removing the update requests from the Postman collection.",
"type": "object",
"additionalProperties": true,
"required": ["action", "method", "path", "mappings", "status"],

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.

why remove existing - > "method", "path",

"method": { "type": "string", "enum": ["GET", "POST"] },
"path": { "$ref": "#/definitions/Path" },
"mappings": { "$ref": "#/definitions/MappingPath" },
"mappings": { "type": "string" },

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.

why changed from the existing code

Comment thread charts/registry-seed/values.yaml Outdated
Comment on lines +136 to +148
#
# OPTIONAL -- the pipeline the network adapter's catalog crawler runs for this
# binding, on its own schedule, to build and publish its catalogs. Adds a
# `publish` action to the row (no method or path; the provider adapter's
# routing sends a publish on). Needs registry chart >= 0.5.0, whose
# ProviderSchema admits `publish`.
# publishPipelineUrl: https://raw.githubusercontent.com/OpenAgriNet/network-adapter/<40-hex-sha>/pkg/plugin/implementation/MandiPrice/publish/agmarknet.yaml
#
# It must be https, shaped <...>/publish/<source>.yaml with its mappings/
# folder beside it (the registry refuses anything else). Pin it to a commit
# SHA: the crawler fetches the file on every run, so a branch URL changes what
# the adapters execute on every push. On a binding that already exists the
# Job adds or repoints the action in place.

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.

dont add this comments here

Comment thread charts/registry-seed/Chart.yaml Outdated
with.
type: application
version: 0.1.1
version: 0.2.0

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.

keep 0.1.2 only

Comment thread charts/registry-seed/CHANGELOG.md Outdated
Comment on lines +8 to +15
## [0.2.0] - 2026-10-26

### Added
- `bindings[].publishPipelineUrl` writes a `publish` action beside `select`
(no method or path). On a binding that already exists the Job adds or
repoints that one action with a PUT of the whole record; every other write is
still create-only. Needs registry 0.5.0+.

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.

under 0.1.2 only

binding = f'{b["participantId"]}|{b["capability"]}'
# actions is a list, not a map: the registry treats every nested
# object as an entity and injects an osid, which a map cannot carry.
actions = [{"action": "select",

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.

keep it as before |. it looks complicated |

…y the seed

Review follow-up on #96:
- ProviderSchema: method, path and the MappingPath ref stay required for every
  action. publish joins the Action enum and MappingPath also accepts a
  <...>/publish/<source>.yaml pipeline URL; the allOf and PublishMappingPath
  are gone.
- registry-seed 0.1.2: the select action is written as before, with the
  publish action (POST /publish) appended when publishPipelineUrl is set.
  ensure_publish_action does its own PUT; values.yaml is unchanged.

Refs #77
The crawler executes the pipeline a publish action names, so its URL must not
be fetchable over plain http. Beckn action mappings keep accepting http or
https as before.

Refs #77
kelvinprabhu added a commit that referenced this pull request Oct 27, 2026
ProviderSchema.json is the chart copy from #96: publish joins the Action enum
and MappingPath also accepts an https <...>/publish/<source>.yaml pipeline URL,
while method, path and mappings stay required for every action. setup.py now
writes the publish action as POST /publish, both on a new binding and when it
adds or repoints the action on an existing one.

Refs #77
kelvinprabhu added a commit that referenced this pull request Oct 27, 2026
The run log must not live on discovery's database: say so, with the shared
postgres cluster as the place for it, and map the pipeline's Agmarknet inputs
from the provider's upstream Secret instead of copying them. The CHANGELOG
names registry-seed 0.1.2, the version #96 ships.

Refs #77
@kelvinprabhu

Copy link
Copy Markdown
Collaborator Author

Dev rollout: OpenAgriNet/infra-automation#19 (PR OpenAgriNet/infra-automation#20) sets publishPipelineUrl on the agmarknet binding. No ordering constraint: the current registry-seed ignores the field.

Base automatically changed from development to release-0.2.0 November 2, 2026 06:48
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.

1 participant