Skip to content

Support private module definition publishing - #125

Merged
mabadir merged 2 commits into
mainfrom
ci/module-definition-publish-flags
Aug 28, 2026
Merged

Support private module definition publishing#125
mabadir merged 2 commits into
mainfrom
ci/module-definition-publish-flags

Conversation

@mabadir

@mabadir mabadir commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add trusted authoring support for published and global definition flags
  • only publish definitions globally on their initial publication when requested
  • skip disabled definitions in publishing, release status, and generated README rows
  • cover private and disabled publication behavior with standalone tests

Why

PR #114 uses these flags for private EKS definitions, but its publish dry-run intentionally executes trusted tooling from main. Landing this prerequisite first lets that check parse and safely plan those definitions.

Validation

  • npm test in tools/ravion-modules (100 passed)

Greptile Summary

This PR adds trusted published and global authoring flags, propagates them through compilation, and excludes disabled definitions from publication and generated documentation. It also restricts global visibility changes to initial publication, but that restriction prevents recovery when the final visibility patch fails after version creation.

  • Validates and compiles the new publication controls with backward-compatible defaults.
  • Filters disabled definitions from publishing, dry-run validation, and README rows.
  • Adds a disabled release state and preserves existing private definitions.
  • Adds standalone coverage for disabled and private publication behavior.

Confidence Score: 4/5

The partial-publication recovery defect should be fixed before merging because a transient final patch failure can leave a globally requested definition permanently private.

Version creation is persisted before global visibility is patched, while subsequent runs suppress that patch solely because a remote version now exists.

Files Needing Attention: tools/ravion-modules/src/publish.ts

Important Files Changed

Filename Overview
tools/ravion-modules/src/authoring-schema.ts Adds validated published and global root flags that default to true.
tools/ravion-modules/src/compiler.ts Carries publication controls alongside the canonical compiled module configuration.
tools/ravion-modules/src/publish.ts Filters disabled definitions and applies global publication only initially, leaving a partial-failure retry gap after version creation.
tools/ravion-modules/src/release.ts Represents disabled publication explicitly and exempts it from release validation.
tools/ravion-modules/src/readme.ts Omits disabled definitions from the generated module table.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Compile authored definition] --> B{published?}
  B -- No --> C[Skip publication]
  B -- Yes --> D[Load remote definition and versions]
  D --> E[Create or reuse definition]
  E --> F[Create first version]
  F --> G{Initial and global?}
  G -- Yes --> H[Patch global visibility]
  H -- Failure --> I[Rerun sees existing version]
  I --> J[Initial becomes false]
  J --> K[Visibility patch is not retried]
Loading
Prompt To Fix All With AI
### Issue 1
tools/ravion-modules/src/publish.ts:221
**Global publication loses retry**

When the first version is created but the subsequent global-visibility patch fails, the persisted version makes `isInitialPublication` false on rerun, so the publisher never retries the patch and leaves a definition with `global: true` private indefinitely.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "support private module definition publis..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@github-actions

Copy link
Copy Markdown

Ravion Module Publish Plan

Dry run only. No Ravion API mutations were made.

No publish changes are required. All versions already exist with identical config.

Comment thread tools/ravion-modules/src/publish.ts Outdated
const shouldPublishDefinitionAfterVersion =
!remoteDefinition || isOrganizationScoped;
const shouldPlanGlobalPublication = isInitialPublication && definition.global;
const shouldPublishDefinitionAfterVersion = isInitialPublication && definition.global;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Global publication loses retry

When the first version is created but the subsequent global-visibility patch fails, the persisted version makes isInitialPublication false on rerun, so the publisher never retries the patch and leaves a definition with global: true private indefinitely.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tools/ravion-modules/src/publish.ts
Line: 221

Comment:
**Global publication loses retry**

When the first version is created but the subsequent global-visibility patch fails, the persisted version makes `isInitialPublication` false on rerun, so the publisher never retries the patch and leaves a definition with `global: true` private indefinitely.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@mabadir
mabadir requested a review from flybayer August 27, 2026 22:35
@mabadir
mabadir merged commit 4ebd708 into main Aug 28, 2026
8 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.

2 participants