Repository navigation
Hua work common - #117
Merged
Merged
Hua work common#117
Conversation
…o 3.0.8 set_uid now resolves the login via get_user_uid() instead of a bare query that exited when no record was on file, so DECS members are no longer blocked from running dsarch/dsrqst/dsupdt when their dssdb.user record is missing. New fallback chain in add_missed_user(): UCAR People API, then dssgrp, then a bare stub. Records that are incomplete are marked stat_flag 'M' and trigger a once-per-process reminder to run 'filluser -i' later. A closed record found by the date-independent lookup is reopened rather than duplicated, but only for a present-day lookup so historical metrics backfills cannot reactivate a user who has since left. ucar_user_info() now reads People API keys defensively, since the API omits keys it has no value for, and skips pgperson/pgusername when those commands are not installed on the host. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… bump version to 3.0.9 Reopening a closed record already has its own message, so the reminder there was redundant noise. Remind only when no dssdb.user record existed at all. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates user-lookup behavior to be more resilient when UCAR People API tooling is unavailable, including adding fallbacks for creating incomplete dssdb.user records and re-opening closed user records for present-day lookups. It also updates pg_opt to use the centralized login-name lookup and bumps the package version.
Changes:
- Add
dssgrp-based and stub fallbacks for creating missingdssdb.userrecords, plus a one-time “run filluser -i” warning. - Reopen closed
dssdb.userrecords (clearuntil_date) for “today” lookups. - Update
set_uid()to useget_user_uid()and bump version to3.0.9.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/rda_python_common/pg_opt.py | Switches UID lookup to get_user_uid() to reuse centralized user-resolution logic. |
| src/rda_python_common/pg_dbi.py | Adds fallback user-record creation, one-time warning, and re-open logic; hardens People API parsing. |
| pyproject.toml | Bumps project version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1704
to
+1706
| def dssgrp_user_info(self, userno, logname = None): | ||
| """Build a partial dssdb.user record from dssdb.dssgrp. | ||
|
|
Comment on lines
+1749
to
+1752
| pgrec = {'userno': userno} if userno else {'logname': logname} | ||
| pgrec['stat_flag'] = 'M' | ||
| if pgrec['stat_flag'] == 'M': self.incomplete_user_warning() | ||
| return self.pgadd("dssdb.user", pgrec, (self.PGDBI['EXITLG']|self.AUTOID)) |
Comment on lines
+1896
to
1899
| email = pgrec.get('email') | ||
| if email and re.search(r'(@|\.)ucar\.edu$', email, re.I): | ||
| email = pgrec['email'] = pgrec.get('ucaremail') | ||
| pgrec['org_name'] = 'NCAR' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.