Skip to content

Allow multiple signoff changes in the same second - #61

Merged
slominskir merged 1 commit into
mainfrom
codex/issue-50-signoff-history
Oct 29, 2026
Merged

slominskir merged 1 commit into
mainfrom
codex/issue-50-signoff-history

Conversation

@slominskir-coding-agent

Copy link
Copy Markdown
Contributor

A second signoff change for the same group and component within one second currently violates GROUP_SIGNOFF_HISTORY_AK1 and rolls back. Allow each event to be recorded using its existing sequence-generated history ID, and preserve the old lookup columns with a nonunique index.

Remove the one-second workaround from MaskingRequestIT and add a regression that rapidly masks, unmasks, and masks a new component, then checks that all three events appear separately and in order in the signoff activity report.

Fixes #50

Upgrade existing databases

Fresh databases get the updated schema from container/oracle/initdb.d/02_ddl.sql. Existing databases need the following SQL in the application PDB before using the fix:

ALTER TABLE SRM_OWNER.GROUP_SIGNOFF_HISTORY
    DROP CONSTRAINT GROUP_SIGNOFF_HISTORY_AK1;

CREATE INDEX SRM_OWNER.GROUP_SIGNOFF_HISTORY_IN1
    ON SRM_OWNER.GROUP_SIGNOFF_HISTORY
       (GROUP_ID, SYSTEM_ID, COMPONENT_ID, MODIFIED_DATE);

The primary key on GROUP_SIGNOFF_HISTORY_ID remains in place. The upgrade was exercised against a disposable database initialized from the original schema.

Validation

  • ./gradlew build passed (compilation, formatting checks, and 90 unit tests).
  • Demonstrated the new regression failing against the original constraint: HTTP 400 with ConstraintViolationException; the app log records ORA-00001 on GROUP_SIGNOFF_HISTORY_AK1. The same test passed after applying the upgrade SQL.
  • Rebuilt the working-tree app image, recreated the isolated Oracle database from the updated initialization scripts, restarted the app, and ran the complete ./gradlew integrationTest suite successfully (60 tests, no skips). The mask acceptance test passes without its former delay.
  • Checked the HTTP entry page and the filtered signoff activity report in headless Chromium. Rapid mask/unmask changes render as separate history rows in the expected order, with no browser page errors. Queried Oracle to confirm all four history rows (creation and three mask changes) for each of the five responsible groups share the same whole-second timestamp and retain distinct history IDs.
  • Inspected the rebuilt app and database logs: no Oracle constraint errors or unexpected application errors; the authorization tests produce their expected denied-access EJB errors. All schema objects are valid.

The VM's default ports were occupied. With user approval, checks used Compose project srm-issue50, a temporary port override, SRM_URL=https://localhost:28443/srm, KEYCLOAK_URL=http://localhost:28081/auth, and MAILHOG_URL=http://localhost:28025. Docker dependency downloads required a host-network build (docker buildx build --network host --allow network.host --load -t srm-issue50-srm .), followed by Compose startup from that image. The local logbook endpoint was disabled.

Decisions

Use the existing history ID as the event identity and replace timestamp uniqueness with a nonunique index. Increasing timestamp precision would still make event identity depend on clock resolution and would require changing both date columns and their producers. The user approved isolated services on unused ports; existing services were left running.

Prepared-by: OpenAI Codex:GPT-6

Replace the group signoff history timestamp uniqueness constraint with a
nonunique index over the same columns. The sequence-generated history ID
already identifies each event, so rapid changes can retain every history
row without rolling back on Oracle DATE's whole-second precision.

Remove the masking request test's delay and add an integration regression
for rapid mask/unmask changes and their separate, ordered history rows.
The pull request includes upgrade SQL for existing databases.

Fixes #50

Assisted-by: Codex:GPT-6
@slominskir
slominskir merged commit a51d2e4 into main Oct 29, 2026
5 checks passed
@slominskir
slominskir deleted the codex/issue-50-signoff-history branch October 29, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source::ai Work done by an AI agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signoff changes to one component in the same second fail with ORA-00001

1 participant