Skip to content
This repository was archived by the owner on Aug 12, 2026. It is now read-only.

chore: install lint tools explicitly for baseline v0.6.2 - #17

Closed
ineedjet wants to merge 25 commits into
mainfrom
feat/extensible-formats-and-providers
Closed

ineedjet wants to merge 25 commits into
mainfrom
feat/extensible-formats-and-providers

Conversation

@ineedjet

Copy link
Copy Markdown
Contributor

In baseline v0.6.2 the individual lint actions no longer self-install their tools — that responsibility moved out of the actions. This adds explicit pip install and actionlint install steps before calling the lint actions, and bumps all three baseline action refs to v0.6.2.

Prerequisite for merging dependabot's rubykatzen/baseline bump PR #16.

ineedjet and others added 25 commits June 21, 2026 12:57
…upport

Introduces two independent plugin-style registries:

- formats/ — Format + LineScanner protocols, with MarkdownFormat (code-fence
  aware), YamlFormat (# comments, block-scalar aware), and TextFormat fallback
- providers/ — Provider + ProviderRegistry with GitHubProvider (was GitHubClient)
  and LocalProvider for local:path refs with no release dependency

Adds a self-hosted update-fragments.yml workflow that installs embedder from
the local repo (pip install -e .) and runs at 10:00 Berlin time (CEST).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove unused imports, sort import blocks, and remove unnecessary
quotes from type annotations to match baseline ruff config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lanks, path traversal

- check_blocks: cache was reusing the first block's asset for subsequent
  blocks from the same repo; fix with resolve_cached() that applies the
  cached tag to the current block's own ref
- update_files: local: refs never refreshed because update_available was
  always false; add always_refresh() to Provider protocol so LocalProvider
  opts in to unconditional re-fetch
- _YamlScanner: blank lines inside YAML block scalars cleared block state
  prematurely, causing false-positive marker detection after blank lines
- LocalProvider: path traversal allowed arbitrary file reads; validate
  resolved path stays within base_dir
- update-fragments-shared.yml: bump pinned version to v0.0.6 and make jq
  backward-compatible with both latest_ref.tag and legacy latest_tag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- formats/__init__: split _FORMATS into _SPECIFIC_FORMATS + _FALLBACK to
  make the TextFormat fallback explicit and remove unreachable code
- local.py: fix cache_key return annotation to str | None per protocol
- yaml.py: extend block-scalar regex to cover indentation indicators
  (|2, >9), chomp+indent combos (|2-, >-2) and trailing comments (| # note)
- update-fragments.yml: build ref string from fields in jq instead of
  using .render (a method, not a JSON field, always serialises as null)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When an embedder block marker is indented (e.g. under a parent YAML
key), apply_updates now re-indents each body line by the same prefix so
the replacement content stays structurally valid after an update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
get_format now returns None for unrecognised file types instead of
falling back to TextFormat with HTML comment markers. parse_blocks and
apply_updates silently skip files with no matching format. MarkdownFormat
is now standalone and no longer inherits from TextFormat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract EmbedderError, EmbedderEnvironmentError, RefError to errors.py
- Move GitHubAssetRef + parse_github_ref into providers/github.py
  (symmetrical with LocalRef in providers/local.py)
- Inline Format/LineScanner protocols into formats/__init__.py
- Inline Provider protocol into providers/__init__.py
- Replace ProviderRegistry class with get_provider() + DEFAULT_PROVIDERS
- Remove lazy imports from parse_blocks/apply_updates (circular dep fixed)
- Delete refs.py, formats/base.py, providers/base.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- YAML scanner: extend _BLOCK_SCALAR_RE to match sequence block scalars
  (- | and - >) in addition to mapping values (key: |), so markers inside
  sequence scalar content are correctly ignored
- parse_blocks: accept optional providers list so custom provider schemes
  work during scanning; thread through scan_paths and update_files
- Replace mutable list defaults with None sentinel in check_blocks,
  update_files, and get_provider to prevent accidental cross-call mutation
- update-fragments-shared.yml: align jq ref rendering with update-fragments.yml
  (handles both GitHub and local refs, removes null fields)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fragments/dependabot-updates.yaml holds the canonical list of update
targets; .github/dependabot.yml embeds it via a local: ref. Demonstrates
YAML format support and local provider working end-to-end — the body
(unindented in the fragment) is automatically re-indented to match the
two-space marker indent under updates: on apply.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fragments/dependabot.yaml holds the canonical config; .github/dependabot.yml
embeds it in full via local:fragments/dependabot.yaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs embedder update before pushing the release branch so that any local
fragments (e.g. dependabot.yml) are up-to-date in the release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
update_files(local_only=True) refreshes blocks whose provider has
always_refresh=True (i.e. local refs) without calling resolve() on
external providers. GitHub refs are left completely untouched.

Used in prepare-release.yml so local fragments (e.g. dependabot.yml) are
synced from disk without bumping external dependency versions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wraps pip install + embedder update --local-only into a reusable
composite action. prepare-release.yml uses it via ./.github/actions/
and external repos can reference it by tag. The action installs embedder
from its own source tree via github.action_path so no separate install
step is needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
local: refs resolve relative to the embedding file's directory, so
fragments/dependabot.yaml was invisible from .github/dependabot.yml.
Moved to .github/fragments/dependabot.yaml where it resolves correctly.

Also fix YAML parse error in action.yml description (unquoted local:).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Python is already available on the runner; no need to install it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously local: paths resolved relative to each embedding file's parent
directory, making cross-directory refs (e.g. from .github/ to fragments/)
impossible without path traversal.

update_files now accepts an explicit base_dir (default Path.cwd()) and
passes it to provider.fetch() for all blocks. This makes all local: refs
repo-root-relative when running embedder from the project root.

Move fragments/dependabot.yaml back to repo-root fragments/ and remove
the orphaned dependabot-updates.yaml fragment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… ref

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce1deff829

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

--body "$body" \
--head "$branch"
fi
uses: ./.github/actions/open-fragments-pr

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 Badge Keep PR action available to reusable-workflow callers

In the shared workflow documented for consuming repos, this step runs after actions/checkout, which checks out the caller's repository. A local uses: ./.github/actions/open-fragments-pr is therefore resolved in the caller workspace; any consumer that does not also vendor this new action will fail before opening the update PR. Keep this inline or reference the action via rubykatzen/embedder/.github/actions/open-fragments-pr@....

Useful? React with 👍 / 👎.

Comment thread src/embedder/blocks.py
Comment on lines +48 to +49
if fmt is None:
return []

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve scanning for non-Markdown text files

For existing managed blocks in .txt, no-extension, or other non-.md/YAML files, get_format() now returns None and parse_blocks silently returns no blocks, so scan, check, and update stop seeing blocks that the previous parser handled in arbitrary text files with HTML markers. This leaves those consumers permanently unupdated; add a default text/HTML-comment format instead of skipping unknown suffixes.

Useful? React with 👍 / 👎.

@ineedjet

Copy link
Copy Markdown
Contributor Author

Superseded by #30 — all changes landed in main via the feat/github-git-ref-provider branch.

@ineedjet ineedjet closed this Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant