Skip to content

Resolve Dr.Egeria credentials at run time with one precedence chain (ISSUE-161) - #477

Merged
dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:fix/issue-161-dr-egeria-credentials
Oct 22, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:fix/issue-161-dr-egeria-credentials

Conversation

@dwolfson

Copy link
Copy Markdown
Member

Fixes ISSUE-161 (PYEGERIA_ISSUES.md; the entry is added in this PR): Dr.Egeria's entry points resolved the Egeria user differently, and two CLIs fixed their user defaults at import time.

Problem

  • dr_egeria and dr_egeria_folder computed their --userid / --user_pass defaults when the module was imported. A caller that set EGERIA_USER after importing pyegeria in the same process still got the earlier user.
  • md_processing/dr_egeria.py (its constants and its python -m entry point) and common_md_utils.py read EGERIA_USER straight from the environment, bypassing config.json and .env. So the entry points disagreed whenever the user was set only in config.

Change

  • New pyegeria.core.config.resolve_egeria_credentials(user_id=None, user_pwd=None). Precedence, read when called: explicit value > EGERIA_USER / EGERIA_USER_PASSWORD environment variables > the User Profile in pyegeria's settings (config.json / .env) > the quickstart defaults.
  • Both CLIs default --userid / --user_pass to None and resolve when the command runs. The help text says so.
  • md_processing/dr_egeria.py and common_md_utils.py use the same helper. The module-level EGERIA_USER / EGERIA_USER_PASSWORD names are kept for code that imports them.

Note: the report that prompted this (RE's Dr.Egeria runs writing as erinoverview) turned out to be RE's own configuration. These are the pyegeria inconsistencies found while checking it.

Testing

  • tests/micro-tests/test_issue_161_dr_egeria_credentials.py: 5 cases.
    • Precedence order.
    • EGERIA_USER set after import, for dr_egeria and dr_egeria_folder.
    • A user set only in config.
    • An explicit --userid wins.
      The three behaviour cases fail with the previous callers and pass with this change.
  • The full micro-test suite (1,425 tests) passes in a clean python:3.13-slim container with no Egeria.

🤖 Generated with Claude Code

dwolfson and others added 2 commits October 21, 2026 16:45
…r differently

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ain (ISSUE-161)

The dr_egeria and dr_egeria_folder CLIs fixed their --userid/--user_pass
defaults when the module was imported, and md_processing/dr_egeria.py
and common_md_utils.py read EGERIA_USER straight from the environment,
bypassing config.json/.env. So the entry points could disagree, and a
user set after import was ignored.

New pyegeria.core.config.resolve_egeria_credentials(): explicit value >
EGERIA_USER/EGERIA_USER_PASSWORD env (read at call time) > settings User
Profile (config.json/.env) > quickstart defaults. Both CLIs default the
options to None and resolve when they run; the md_processing constants
and __main__ path use the same helper. Module-level names are kept.

Micro-tests: tests/micro-tests/test_issue_161_dr_egeria_credentials.py
(the three behaviour cases fail with the old callers). Full micro-test
suite passes in a clean python:3.13-slim container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 6a88566 into odpi:main Oct 22, 2026
5 checks passed
dwolfson added a commit that referenced this pull request Oct 22, 2026
Ships #477 (ISSUE-161: Dr.Egeria entry points resolve the Egeria user
at run time with one precedence chain, via resolve_egeria_credentials)
and #478 (Dr.Egeria Postgres Server/Database Element commands take
secrets-store attributes; Database User Id / Database Password removed).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
dwolfson added a commit that referenced this pull request Oct 28, 2026
* docs(issues): re-sort the issue trackers, open items first

PYEGERIA_ISSUES.md:
- Released fixes still marked "not yet released" now name the PR and
  release: ISSUE-111/113/129/134/136 (#446) and ISSUE-135 (#445) in
  6.2.2, ISSUE-153 (#460) 6.2.5, ISSUE-160 (#474/#475 6.2.8, #478 6.2.9),
  ISSUE-161 (#477) 6.2.9, ISSUE-162 (#482) and ISSUE-163/164 (#483)
  6.2.10. ISSUE-166 notes the pyegeria side (#498, 6.2.13).
- Moved the fixed entries (ISSUE-153, 160-166) from the open sections
  to the top of Fixed / Resolved.
- Awaiting re-test is now a real section after the open ones, holding
  ISSUE-125, 124, 117, 112, 90, 95 and 89. Its old header sat in the
  middle of the Fixed list, where everything under it except ISSUE-95
  and ISSUE-89 was already fixed.
- The At-a-glance counts and lists are rebuilt from the section
  contents (14 open pyegeria items, 7 awaiting re-test, 5 open Egeria
  Server issues), and the re-test section notes the quickstart now runs
  Egeria main abe31272.

EGERIA_OPEN_ISSUES.md: drop the fixed ISSUE-166 entry, and move
ISSUE-79 (Egeria needs information) and ISSUE-38 (pending oak2026
merge) out of Awaiting re-test, matching their 2026-10-18 status.

No entry text was removed: 166 entries before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pdMuTg6FmqPWeapeXM54g
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

* docs(issues): ISSUE-165 released in 6.2.11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pdMuTg6FmqPWeapeXM54g
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

---------

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@dwolfson
dwolfson deleted the fix/issue-161-dr-egeria-credentials branch October 30, 2026 16:35
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