Skip to content

Fix CI failures: lint, compile, addon structure, Windows install - #4

Merged
eduralph merged 4 commits into
maintenance/gramps60from
feature/ci-cd-pipeline
Apr 17, 2026
Merged

Fix CI failures: lint, compile, addon structure, Windows install#4
eduralph merged 4 commits into
maintenance/gramps60from
feature/ci-cd-pipeline

Conversation

@eduralph

Copy link
Copy Markdown
Owner

Resolves all failing CI jobs in one pass so the pipeline can go green.

CI config:

  • Compile Check: add shell: bash (default sh -e can't parse the bash process substitution)
  • Windows: switch to conda environment-file so mamba actually installs Gramps + deps into addons-ci (the previous mamba install step silently no-op'd). Adds a Verify step that prints mamba list and imports the deps to fail fast if they aren't there.

Addon structure:

  • Create po/template.pot stubs for AnniversariesGramplet, ArchiveAssist, GrampsChat, GrampyScript — they had no po/ dir at all.

Lint (79 → 0 ruff errors across 29 files):

  • Missing imports: WindowActiveError, ErrorDialog, DbTxn, EditDate, ReportError, EventType, Surname, Any, display_help, reduce, time, sys, Errors
  • os.name is 'nt'== 'nt'; tuple-in-if bug in LifeLineChartView
  • Removed dead code after return in AttachSourceTool; broken stub line in SourceIndex/index.py
  • Python 2 leftovers: except E(msg)except E as msg, unicode()str(), removed basestring/reload branches
  • Added _ translation in MongoDB and libaccess; fixed broken lambda missing value param in libaccess
  • Renamed SurnameMappingGramplet.grp.py → .gpr.py (typo — file was never loaded by Gramps, which only recognizes .gpr.py)
  • Fixed print(...).format(...) missing close paren in QueryQuickview
  • Dropped invalid parent=self.uistate.window at module level in lxmlGramplet (no self exists outside instance methods)
  • Fixed displayer.display(...)name_displayer.display(...) in QuiltView (matches the import alias)
  • Initialized tmg_dataset = None in TMGimporter so ruff can prove the locals() guard isn't needed
  • Fixed LOG.warn("ignored: " + data)+ line in JSONImport (wrong var — would crash if it ever hit that branch)

eduralph and others added 4 commits April 17, 2026 19:15
Resolves all failing CI jobs in one pass so the pipeline can go green.

CI config:
- Compile Check: add `shell: bash` (default `sh -e` can't parse the
  bash process substitution)
- Windows: switch to conda environment-file so mamba actually installs
  Gramps + deps into `addons-ci` (the previous `mamba install` step
  silently no-op'd). Adds a Verify step that prints `mamba list` and
  imports the deps to fail fast if they aren't there.

Addon structure:
- Create po/template.pot stubs for AnniversariesGramplet, ArchiveAssist,
  GrampsChat, GrampyScript — they had no po/ dir at all.

Lint (79 → 0 ruff errors across 29 files):
- Missing imports: WindowActiveError, ErrorDialog, DbTxn, EditDate,
  ReportError, EventType, Surname, Any, display_help, reduce, time,
  sys, Errors
- 3× `os.name is 'nt'` → `== 'nt'`; tuple-in-if bug in LifeLineChartView
- Removed dead code after `return` in AttachSourceTool; broken stub
  line in SourceIndex/index.py
- Python 2 leftovers: `except E(msg)` → `except E as msg`,
  `unicode()` → `str()`, removed `basestring`/`reload` branches
- Added `_` translation in MongoDB and libaccess; fixed broken lambda
  missing `value` param in libaccess
- Renamed SurnameMappingGramplet.grp.py → .gpr.py (typo — file was
  never loaded by Gramps, which only recognizes .gpr.py)
- Fixed `print(...).format(...)` missing close paren in QueryQuickview
- Dropped invalid `parent=self.uistate.window` at module level in
  lxmlGramplet (no self exists outside instance methods)
- Fixed `displayer.display(...)` → `name_displayer.display(...)` in
  QuiltView (matches the import alias)
- Initialized `tmg_dataset = None` in TMGimporter so ruff can prove
  the `locals()` guard isn't needed
- Fixed `LOG.warn("ignored: " + data)` → `+ line` in JSONImport
  (wrong var — would crash if it ever hit that branch)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Gramps is not published on conda-forge, so keep the binary deps
(pygobject, gtk3) on conda and install gramps+orjson+pytest+dbf via pip.

Move the env file out of .github/workflows/ so the IDE stops applying
the GitHub Actions workflow schema to it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In-memory Gramps SQLite DB init hangs on Windows under the pip-installed
Gramps + conda-forge GTK stack. Move the 99 DB-using TMG tests into
test_integration_libtmg.py so the Windows unit job skips them via the
existing --ignore-glob='**/test_integration*.py' filter.

The 58 pure-logic tests (strip codes, date parsing, repo type / URL
inference) stay in test_libtmg.py and run on both Linux and Windows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Merge test_integration_libtmg.py into test_integration.py — shared helpers
(_Rec, _table, _make_db, _add_person) are deduplicated at the top, and
the E2E RELPH-pipeline class now sits alongside the 12 DB-backed
function-level test classes (117 tests total).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@eduralph
eduralph merged commit 75d9702 into maintenance/gramps60 Apr 17, 2026
7 checks passed
@eduralph
eduralph deleted the feature/ci-cd-pipeline branch May 26, 2026 23:34
eduralph added a commit that referenced this pull request Jul 9, 2026
Addresses a second-pass adversarial review whose theme was that advisory
buckets can hide real defects, plus a clearer failure message.

Failure message (test_load_all_addon_modules): on failure, lead with only the
real load failures (each with its error), then one plain-language line per
advisory category explaining the cause and the fix. The full advisory lists
stay in the warning log instead of burying the actionable failures under a
wall of text.

#1 Environment classifier is now specific and anchored. Dropped the over-broad
signatures ("DISPLAY", bare "load_icon") that could match a genuine addon
exception; kept anchored ones ("Gtk couldn't be initialized",
"gtk-icon-theme-error-quark", the NoneType-load_icon phrase, missing-namespace)
and only match them on a real error line, not an indented traceback frame or
echoed source. Added TestEnvLoadClassifier with positive and negative cases.

#2 A real import hang no longer passes as advisory. The isolated-load
subprocess prints REGISTRY_READY after registration; on timeout, if the marker
was emitted the addon's own import hung -> hard failure, otherwise the registry
scan was slow -> advisory. (subprocess.TimeoutExpired captures partial stdout,
so this needs no signals and works cross-platform.)

#4 Opt-in strict mode for the depends_on load test. Environmentally
inconclusive dependents stay advisory by default (headless local runs
legitimately can't import GUI addons); setting GRAMPS_ADDON_TEST_STRICT=1 in a
CI job with a full runtime promotes any unverified dependent to a failure.

The i18n finding was again out of scope: test_i18n_extraction.py is
pre-existing on maintenance/gramps60, not part of this PR.

Verified against Gramps 6.0.8: classifier unit tests pass, the headless load
test still passes with ClipboardGramplet kept advisory, hang-vs-slow-scan and
strict-mode gating behave as intended.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant