Skip to content

fix(audit): populate cluster_context and cleanup_mode, drop workload timestamps#79

Merged
mrhillsman merged 1 commit into
mainfrom
fix/audit-schema-unused-columns
May 23, 2026
Merged

fix(audit): populate cluster_context and cleanup_mode, drop workload timestamps#79
mrhillsman merged 1 commit into
mainfrom
fix/audit-schema-unused-columns

Conversation

@mrhillsman

@mrhillsman mrhillsman commented May 23, 2026

Copy link
Copy Markdown
Contributor

Schema changes:

  • Remove unused started_at and completed_at columns from workload_details table
  • These columns were declared but never populated

Populate audit_log.cluster_context:

  • Modify cluster.Connect to return (client, contextName, error)
  • Add ClusterContext field to config.Config (runtime-only)
  • Set cfg.ClusterContext after cluster connection in runE and cleanupE
  • Update StartExecution to insert cluster_context value
  • Context is set to "in-cluster" for service account auth, NULL for dry-run

Populate audit_log.cleanup_mode:

  • Set cfg.CleanupMode in cleanupE based on flags before StartExecution
  • Values: "all" (no filter), "run-id" (specific run), "dry-run" (no deletion)
  • NULL for run commands

Test coverage:

  • Add tests verifying cluster_context and cleanup_mode are recorded
  • Update existing tests for cluster.Connect signature change
  • All tests pass

Documentation:

  • Update docs/audit-schema.md to reflect schema changes
  • Document cluster_context and cleanup_mode column meanings
  • Remove workload timestamp columns from ERD and table descriptions

Resolves #64 Resolves #65 Resolves #66

@exe-prow-github-app
exe-prow-github-app Bot requested a review from OchiengEd May 23, 2026 05:35
@exe-prow-github-app

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrhillsman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2026
@mrhillsman
mrhillsman removed the request for review from OchiengEd May 23, 2026 05:35
@mrhillsman
mrhillsman force-pushed the fix/audit-schema-unused-columns branch from 6d58aa7 to e5cf199 Compare May 23, 2026 05:38
…timestamps

Schema changes:
- Remove unused started_at and completed_at columns from workload_details table
- These columns were declared but never populated

Populate audit_log.cluster_context:
- Modify cluster.Connect to return (client, contextName, error)
- Add ClusterContext field to config.Config (runtime-only)
- Set cfg.ClusterContext after cluster connection in runE and cleanupE
- Update StartExecution to insert cluster_context value
- Context is set to "in-cluster" for service account auth, NULL for dry-run

Populate audit_log.cleanup_mode:
- Set cfg.CleanupMode in cleanupE based on flags before StartExecution
- Values: "all" (no filter), "run-id" (specific run), "dry-run" (no deletion)
- NULL for run commands

Test coverage:
- Add tests verifying cluster_context and cleanup_mode are recorded
- Update existing tests for cluster.Connect signature change
- All tests pass

Documentation:
- Update docs/audit-schema.md to reflect schema changes
- Document cluster_context and cleanup_mode column meanings
- Remove workload timestamp columns from ERD and table descriptions

Resolves #64 Resolves #65 Resolves #66

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@mrhillsman
mrhillsman force-pushed the fix/audit-schema-unused-columns branch from e5cf199 to 388d7ba Compare May 23, 2026 05:47
@mrhillsman
mrhillsman merged commit 1595bae into main May 23, 2026
3 of 4 checks passed
@mrhillsman
mrhillsman deleted the fix/audit-schema-unused-columns branch May 24, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

1 participant