Skip to content

feat(registry): Require and validate registry metadata on first publish#777

Merged
s1gr1d merged 7 commits intomasterfrom
sig/registry-docs-url
Mar 20, 2026
Merged

feat(registry): Require and validate registry metadata on first publish#777
s1gr1d merged 7 commits intomasterfrom
sig/registry-docs-url

Conversation

@s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Mar 18, 2026

A package was published to the release registry without main_docs_url set. Now, we use repo_url as mainDocsUrl fallback and emit warnings on missing metadata.

Related Sentry PR: getsentry/sentry#110902

This PR adds upfront validation warnings and clearer, rewritten documentation for all config options (the diff looks big as I ran prettier).

Validation

For all new packages (apps, SDKs), it checks:

  • name
  • mainDocsUrl (can also use the fallback value of repo_url)

When an sdkName is provided, we can safely assume that a new SDK will be added and we additionally check for packageUrl.

In case of missing options, the workflow will fail -> avoids incorrect registry states.

@s1gr1d s1gr1d requested review from BYK, JPeer264 and Lms24 March 18, 2026 12:45
@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-20 12:32 UTC

@s1gr1d s1gr1d force-pushed the sig/registry-docs-url branch from 2d2b2fd to 3a8acc3 Compare March 18, 2026 12:54
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

However, we cannot fail if something is missing because there might always be packages where a certain manifest configuration is allowed (e.g. without a package_url).

The problem is that prior to craft supporting adding the first release registry entry, the instructions for manually adding a new package to the registry specified these fields to be set. I'm assuming that so far we always stuck to this (?). At least for main_docs_url it seems we did, otherwise we would have run into the incident sooner.

As we saw with INC-2084, this implicitly means these fields can always expected to be present by API consumers. I'm not sure if we adhere to this in every entry but I'm afraid that if we don't require the fields via Craft for the first publish, we run into similar situations again. The release registry API is consumed by Sentry, Docs, Sentry CLI, and probably some other projects. So not sure which other consumers might assume that all of these properties are present.

So bottom line, I think that we should fail for the first publish if any properties are missing, but not for any already published packages. Fully realize though that I might lack some context here. @s1gr1d @BYK wdyt?

@BYK
Copy link
Member

BYK commented Mar 18, 2026

So bottom line, I think that we should fail for the first publish if any properties are missing, but not for any already published packages. Fully realize though that I might lack some context here. @s1gr1d @BYK wdyt?

Strong agree. We started using release registry information in sentry init for instance and lack of main_docs_url is a big deal.

s1gr1d added 2 commits March 19, 2026 11:40
perform SDK validation for new packages
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing! LGTM from my end!

Comment on lines +51 to +54
| `name` | Your `.craft.yml` config. Applied on every publish, can be updated at any time |
| `package_url` | Your `.craft.yml` config. Applied on every publish, can be updated at any time |
| `main_docs_url` | Your `.craft.yml` config. Applied on every publish, can be updated at any time |
| `api_docs_url` | Your `.craft.yml` config. Applied on every publish, can be updated at any time |
Copy link
Member

Choose a reason for hiding this comment

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

We need the mapping for these from the .craft.yml config. (main_docs_url -> mainDocsUrl etc.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Added two columns with both variable names 👍

@s1gr1d s1gr1d enabled auto-merge (squash) March 20, 2026 12:31
@s1gr1d s1gr1d merged commit ce1233d into master Mar 20, 2026
19 checks passed
@s1gr1d s1gr1d deleted the sig/registry-docs-url branch March 20, 2026 12:32
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.

3 participants