Skip to content

fix: repair master — lint, a dropped method, vendored drift, scorecard - #132

Open
Kartikey1306 wants to merge 3 commits into
embeddedos-org:masterfrom
Kartikey1306:fix/repair-master-lint-drift-scorecard
Open

fix: repair master — lint, a dropped method, vendored drift, scorecard#132
Kartikey1306 wants to merge 3 commits into
embeddedos-org:masterfrom
Kartikey1306:fix/repair-master-lint-drift-scorecard

Conversation

@Kartikey1306

@Kartikey1306 Kartikey1306 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Problem

CI — ebuild has been red on master since the 09-08 batch merge, and because the first failing step is ruff, everything behind it (mypy, pytest) has not run on master since. Vendored core drift and OSSF Scorecard are red on the same commit for unrelated reasons.

Verified against runs 34419838440 (CI — ebuild on 8b623d5, all nine Test legs at Lint (ruff)), 34419838427 (drift) and 34419838445 (Scorecard), and reproduced locally on master before every fix below.

What broke

Lint (ruff, 4 findings). A duplicate import shutil (F811), a lost trailing newline (W292), and two imports two hundred lines down test_ci_gate.py (E402) — that last one is my own #103, replayed onto a file that had moved. These three hunks are byte-identical to #122's (blobs e08444f, 3c25922, b1d5e0f), so whichever merges first leaves the other clean.

Type check + tests (never reached on master since 09-08). ebuild/packages/index_sync.py:354 calls PackageRecipe.to_dict(). #111 defined it; #112, merged five minutes later from a base without it, deleted it in its replay. mypy names it once; pytest fails nine test_index_sync cases with AttributeError. The method is restored verbatim from #111 (cc90078): it emits the package: / build: keys that parse_recipe() reads back, which an asdict() replacement would not — the YAML it writes has to round-trip through the same parser. #119 and #124 both propose re-implementations; this is a restoration of what master already had, not a third design.

Two more steps that had never passed, found on this PR's first run (run 34591499237), once ruff let the job past its first step:

  • mypy on 3.10 / 3.11 only. ebuild/plugins/__init__.py:46 — those interpreters' stubs type entry_points() as the deprecated mapping whose .get() wants an EntryPoints default (arg-type). The line carried # type: ignore[attr-defined], the wrong error code, so it suppressed nothing. Spelled out with a cast, byte-identical to ci: fix the lint findings that stop CI before any test runs #122's hunk (blob 54605f0).
  • yamllint on Windows only. The Windows runners check out with core.autocrlf=true, so every YAML file arrives CRLF and the default new-lines: unix rule rejected every line of templates.yaml and layers/eni/build.yaml. The step was added 09-03 and has never passed on that leg. A first attempt (new-lines: platform) failed the other way: auto-assign.yml carried one stray CR, so autocrlf left it alone and Windows then expected CRLF on its first line. Fixed properly: .gitattributes pins *.yml/*.yaml to eol=lf so every OS lints the same bytes, yamllint keeps its default unix rule, and the stray CR is gone.

Vendored core drift. #109 (dba3d83) edited core/eos/docs/three-way-alignment.md, a vendored copy pinned to eos 5544c98, so drift went 44 → 45 and the guard failed exactly as core/UPSTREAM.yaml says it should. Reverted to the pinned content — verified the result is blob 7f9c8c1, the same bytes as eos:docs/three-way-alignment.md at the pin. The alignment note itself is worth keeping; it belongs in ebuild's own docs or upstream in eos, not in the snapshot.

OSSF Scorecard. ossf/scorecard-action@v2.4.0 pulls gcr.io/openssf/scorecard-action, and gcr.io now refuses with "This API method requires billing to be enabled". v2.4.3 pulls from ghcr.io; eos already pins it and its Scorecard job is green.

Test plan

Verified, run the way ci.yml runs them:

ruff check .                                                    → All checks passed
yamllint .                                                      → clean
mypy . --ignore-missing-imports --no-strict-optional --exclude '^(layers|core|promo)/'
                                                                → no issues in 107 source files
python -m pytest tests/                                         → 680 passed, 1 skipped
python scripts/check_vendor_drift.py                            → core/eos 44/44 OK, core/eboot 46/46 OK

Not in this PR

EoSim Sanity's Windows and macOS legs install a wheel that has never been published (run 34561966328); #121 already replaces that with the clone the other legs use.

CI -- ebuild has been red on master since the 09-08 batch merge, and the
first failing step (ruff) has hidden the ones behind it.

Lint (ruff, all nine Test legs):
- test_build_dir_resolution.py imported shutil twice (F811).
- test_package_recipe.py lost its trailing newline (W292).
- test_ci_gate.py had `import itertools` / `import re` two hundred lines
  down (E402) -- my own embeddedos-org#103, replayed onto a file that had moved.
  These three hunks are byte-identical to embeddedos-org#122's, so either PR merging
  first leaves the other clean.

Type check and tests (never reached on master since 09-08):
- ebuild/packages/index_sync.py calls PackageRecipe.to_dict(), which embeddedos-org#111
  defined and embeddedos-org#112 -- merged five minutes later from a base without it --
  deleted in its replay. mypy names it once; pytest fails nine
  test_index_sync cases with AttributeError. The method is restored verbatim
  from embeddedos-org#111 (cc90078): it emits the `package:`/`build:` keys parse_recipe()
  reads back, which an asdict() replacement would not.

Vendored core drift:
- embeddedos-org#109 (dba3d83) edited core/eos/docs/three-way-alignment.md, a vendored copy
  pinned to eos 5544c98, so drift went 44 -> 45 and the guard failed as
  designed. Reverted to the pinned content (blob 7f9c8c1, the same bytes as
  eos:docs/three-way-alignment.md at the pin). The alignment note belongs in
  ebuild's own docs or upstream in eos, not in the snapshot.

OSSF Scorecard:
- ossf/scorecard-action@v2.4.0 pulls gcr.io/openssf/scorecard-action, and
  gcr.io now refuses the pull ("requires billing to be enabled"). v2.4.3
  pulls from ghcr.io; eos already pins it and its Scorecard job is green.

Not in this PR: EoSim Sanity's Windows/macOS legs install a wheel that has
never been published; embeddedos-org#121 (srpatcha) already replaces that with the clone
the other legs use.

Verified locally: ruff clean, yamllint clean, mypy clean over 107 files,
680 passed / 1 skipped, scripts/check_vendor_drift.py 44/44 and 46/46.
@codecov-commenter

codecov-commenter commented Sep 11, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ebuild/packages/recipe.py 68.42% 3 Missing and 3 partials ⚠️
ebuild/plugins/__init__.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…/3.11, yamllint on Windows

Both surfaced on this branch's first CI run, once ruff let the job get past
its first step.

- ebuild/plugins/__init__.py: on Python 3.10 and 3.11 the stubs type
  entry_points() as the deprecated mapping, and its .get() wants an
  EntryPoints default, so mypy fails with arg-type. The line carried a
  '# type: ignore[attr-defined]' -- the wrong error code, so it suppressed
  nothing. Spelled out with a cast, byte-identical to embeddedos-org#122's hunk (54605f0).

- .yamllint.yml: the Windows runners check out with core.autocrlf=true, so
  every YAML file arrives as CRLF and the default new-lines: unix rule
  rejected every line. The step was added on 09-03 and had never passed on
  that leg. new-lines: platform accepts the checkout's own convention.
…e checkout's line ending

new-lines: platform was the wrong fix. The Windows runners' autocrlf turns
LF files into CRLF -- except a file that already carries a stray CR, which
git leaves alone, and auto-assign.yml had one on its last line. So under
'platform' Windows expected CRLF and got LF on that file's first line, and
the leg was red again for the opposite reason.

Pin *.yml and *.yaml to eol=lf so every OS lints the same bytes, keep
yamllint's default unix rule, and drop the stray CR.
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