Skip to content

[Draft] OBI-28: Approval decisions and protected Git delivery #18

Done
7 of 13 issues completed
Done

Description

@ephico2real2

Part of #8

Story

As a approver, I want to approve exactly the change that will reach a cluster.

Business value

The plan (#6) sets this release exit for phase 2: "rnd namespace POST to Synced with one portal approval and no manual Git step; edited approved PR fails cmapi check. Auto-approval remains disabled."

Context

build-tracker.md links PR #40 to this story. The worker jobs open_pr and pr_checks are on main. The Git host is a Gitea stand-in, which Wave 3 removes (#85). The GitHub adapter has not run against GitHub (#61).

Acceptance criteria

  • Approve/reject permissions and environment rules are enforced; request audit records the decision, shown by cmapi/tests/service/test_review_c_authz.py::test_environment_role_cannot_approve_or_reject_in_another_environment, and a new test in cmapi/tests/service/ for the audit record, not written yet
  • Only approved requests create bot PRs, shown by a new test in cmapi/tests/service/, not written yet
  • CI validates schema, kubeconform, Kyverno and the cmapi check; post-approval changes fail plan-hash verification, shown by cmapi/tests/service/test_flow.py::test_pr_edited_after_approval_fails_the_cmapi_check and ::test_validator_findings_refuse_the_plan
  • Git reviews cannot substitute for cmapi approval; auto-approval stays off until fresh capacity is available, shown by cmapi/tests/service/test_flow.py::test_auto_approval_kill_switch and cmapi/tests/core/test_approvals.py::test_missing_capacity_facts_do_not_auto_approve

Tasks

Out of scope

  • The source states none for this story.

Evidence

Definition of done

  • Mockup approved, or the work has no screen and no API shape
  • Draft pull request open
  • Build: tests fail before the change and pass after it
  • Documented where a reader looks for it
  • Review ruled
  • Merged with its proof
  • Released on the default branch
  • The owner approves, after a comment cites the proof for each criterion and its cluster

Class

INV. The story adds a new capability to the product.

Source

Status: Draft backlog. No sprint commitment.

Owner in Paperclip: Ahsoka. Ahsoka mentors Luke and assigns bounded engineering work after technical review.

Source: OBI-28.
Epic: #8. Plan, release windows, and review gates: #6.

Dependencies: #7 (OBI-21), OBI-19, OBI-20.

Planned story; phase 2, provisional 8 points (Ahsoka/Yoda to validate).

  • Attach automated or reproducible evidence for each criterion; cover denial/failure paths.
  • Read the plan; Yoda owns design choices. Keep this in backlog until prerequisite phase evidence is accepted. Ahsoka may split and delegate to Luke with mentorship.

Language acceptance criterion

Before sprint entry, the owner must define technical terms and attach language review evidence for this text revision.
Use simple-english 2.1.1, Strict mode. Index #6 records the vocabulary source and review limits.

The source criteria remain unchanged. Language review remains open.

Sub-issues

Sub-issues

7 of 13 Issues completed
Loading 13 sub-issues

Activity

  1. added
    In-Progress
    class:INV
    status:partly-fixed
    story
    on Nov 13, 2026
  2. ephico2real2 commented on Nov 13, 2026

    @ephico2real2
    OwnerAuthor

    Work tag: In-Progress. A part of this story is merged: PR #40, merge commit 1f30ab1, on 2026-11-05 (build-tracker.md, "Stories and epics"). The story is not complete, and no cluster proves it. Read from gh and git at 2026-11-13T09:18Z.

  3. 1 remaining item

  4. added a commit that references this issue on Nov 16, 2026
  5. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    New defect under this story: #764 (High, security), found while fixing #60.

  6. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    New defects under this story: #779 (Medium, security: :reject does not check the approving group) and #780 (Medium: a rejection records no approvals row and no approving group). Both found while writing the audit test for this story's first criterion.

  7. added 3 commits that reference this issue on Dec 1, 2026
  8. added a commit that references this issue on Dec 1, 2026
  9. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    Proof for each acceptance criterion of #18, written by the coordinator on 2026-12-01. It is for the owner to approve closing this story.

    Sources:

    1. Approve and reject permissions and environment rules are enforced; the request audit records the decision

    • Environment rules: cmapi/tests/service/test_review_c_authz.py:134 test_environment_role_cannot_approve_or_reject_in_another_environment.
    • Audit: cmapi/tests/service/test_decisions_story_18.py:59 test_each_decision_is_an_audit_event_with_who_when_and_what.
      • An approve and a reject each write one audit_events row: who, the client, the action, the comment and the request, at a time inside the call.
      • A refused decision changes no table: requests, events, approvals, audit and jobs are all unchanged.
      • Opal's reject outside the needed group is refused, beside her approve.
      • :133 test_an_approval_is_audited_while_another_approval_is_still_needed.
    • Reject takes the approve checks (SEC: :reject does not check the approving group, so an approver outside the request's slots can reject it #779) and is an approvals row (A rejection records no approvals row and no approving group, though docs/01 says each decision is an approvals row and an audit event #780): cmapi/tests/service/test_reject_decision_779_780.py. It tests an approver outside the group, the requester where self-approval is forbidden, the submitter on behalf of someone, and someone who already approved. Each is refused. A rejection is an approvals row with its group and an audit event. Migration 0014's round trip is tested too.
    • CRC: req-20261201-0003, pending from 16:34:11Z.
      • POST :approve as cmapi.approver-platform answered 200.
      • The approvals row and the request events approval and approved are by cmapi.approver-platform.
      • There is one request.approve audit event.
      • No rejection ran on CRC.

    2. Only approved requests create bot PRs

    • Test: cmapi/tests/service/test_decisions_story_18.py:160 test_only_an_approved_request_gets_a_bot_branch_and_pr.
      • A pending and a rejected request get no branch push and no PR, even when the jobs are queued by hand.
      • The approved control gets one PR.
    • CRC: req-20261201-0003 had no PR while pending. Its first push_branch (job 18146) was created in the approval's transaction (16:34:38.923089Z), and PR Create the LDAP bind user cmapi-ldap-bind on the existing LDAP server #34 followed at 16:34:48Z.

    3. CI validates schema, kubeconform, Kyverno and the cmapi check; post-approval changes fail plan-hash verification

    4. Git reviews cannot substitute for cmapi approval; auto-approval stays off until fresh capacity is available

    • Tests:
      • cmapi/tests/service/test_flow.py:357 test_auto_approval_kill_switch.
      • cmapi/tests/core/test_approvals.py:215 test_missing_capacity_facts_do_not_auto_approve.
    • Git reviews: docs/01 says "Git reviews carry no authority". No test drives a Git review.
    • CRC: req-20261201-0001 was auto-approved by auto:baseline-rnd-namespace with capacity fits.

    Not proven, or open:

  10. ephico2real2 commented on Dec 1, 2026

    @ephico2real2
    OwnerAuthor

    Closed with the owner's approval, 2026-12-01 ("Close #18"). The proof is in the comment above. #60 (the branch-protection part), #764 and #227 stay open as accepted lab risks, and #789 waits on the owner's decision.

  11. ephico2real2 commented on Dec 2, 2026

    @ephico2real2
    OwnerAuthor

    Filed #824 under this story: the local reference app's :reject skips the ledger's decision checks. Found while implementing #811, and fixed in #811's pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-Progressclass:INVstatus:partly-fixedstory

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions