Skip to content

feat: Add support for project felt#188

Closed
jschuler wants to merge 4 commits intopatternfly:mainfrom
jschuler:felt
Closed

feat: Add support for project felt#188
jschuler wants to merge 4 commits intopatternfly:mainfrom
jschuler:felt

Conversation

@jschuler
Copy link
Copy Markdown

@jschuler jschuler commented May 6, 2026

Summary

  • Add support for dynamic GitHub directory expansion in the docs catalog, enabling project-felt/ai-guidelines content to be
    resolved at startup from a single stub entry in docs.json
  • Introduce expandGithubDirectory catalog stub type that lists Markdown files via the GitHub Contents API and expands them into
    concrete catalog rows
  • Add project-felt URLs to the fetch allowlist
  • Gracefully degrade when GitHub API is unreachable or returns an empty directory — the server starts with the remaining catalog
    instead of crashing

Changes

  • catalog.expandGithubDirectory.ts (new) — Core expansion logic: fetches a GitHub directory listing, filters for Markdown
    files, and maps each file to a resolved catalog doc. Includes a repo allowlist for defense in depth. Logs a warning instead of
    throwing on empty directories.
  • docs.embedded.ts — New types: PatternFlyMcpDocsCatalogDocStub, ExpandGithubDirectoryConfig,
    PatternFlyMcpDocsCatalogSource to model stub entries and the import-time catalog shape.
  • docs.json — Added AiGuidelines entry with an expandGithubDirectory stub pointing to
    project-felt/ai-guidelines/content.
  • patternFly.getResources.ts — Calls expandGithubDirectoryInCatalog after loading the catalog. On failure, strips
    unresolved stubs and returns the catalog with isFallback: true.
  • options.defaults.ts — Added project-felt GitHub URLs to the allowlist.
  • resource.patternFlyDocsTemplate.ts / tool.patternFlyDocs.ts — Narrowed .filter(Boolean) to proper type guards
    since entries may now lack a path field.
  • Tests — Added aiGuidelines.catalog.test.ts, catalog.expandGithubDirectory.test.ts, fixture data, scoped fetch mock
    helper, and updated existing tests for the new catalog shape.

Test plan

  • npx jest — all unit tests pass
  • Verify server starts without network access (fallback path)
  • Verify AiGuidelines entries appear in search results and resource listings
  • Confirm expansion allowlist rejects repos not in the list

@jschuler jschuler requested a review from cdcabrera as a code owner May 6, 2026 16:43
@cdcabrera cdcabrera added the hold review needed label May 6, 2026
@cdcabrera
Copy link
Copy Markdown
Member

@jschuler aspects of this work are available

  • without the need for "feat" work
  • currently in progress under API work

I'm going to shut this down, because it requires an issue first

@cdcabrera cdcabrera closed this May 6, 2026
@cdcabrera cdcabrera added the missing issue Needs a related issue and mapping before opening work! label May 6, 2026
@jschuler
Copy link
Copy Markdown
Author

jschuler commented May 6, 2026

@cdcabrera can you provide more information on where aspects of this work are available?

Also generally it is better to keep a PR open and ask for an Issue to be created. It comes across as rude otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold review needed missing issue Needs a related issue and mapping before opening work!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants