Skip to content

Move the membership lookup to Python, tested against a local HTTP stub #14

Closed

Description

@cipherstash-agent

Related

Follow-up to #1, after the v1.0.0 release (#8).

What to build

The membership lookup becomes code we can test offline. The decide job's lookup step is rewritten in Python using only the standard library, and stays inline in the reusable workflow, as the request decision's jq program does, because a reusable workflow cannot reach this repository's files. A new Python unittest suite extracts the step's code from the workflow with yq and runs it against an HTTP stub started inside the test, so every way GitHub can answer is checked before a change merges.

This first slice also sets up the harness the next three tickets reuse.

Acceptance criteria

  • The lookup step is standard-library Python only (no packages installed), using features available in Python 3.10.
  • Its behaviour is unchanged: 200 with state active gives member; 200 with any other state gives not-member; 404 for an existing team gives not-member; 404 for the team itself, any other status, a timeout, a connection failure, a malformed response, a missing or empty App token, and an org, team or requester name that fails validation each give lookup-failed with an error annotation.
  • The App token is sent as a request header set in the program, never on a command line or in output.
  • Unit tests cover every outcome above against an in-process stub server, with no network and no Docker.
  • The Checks workflow runs the unit tests on every pull request, alongside the saved decision cases and actionlint.
  • The README says how to run and add unit tests.

Blocked by


Generated by Claude Code

Activity

  1. cipherstash-agent commented on Nov 18, 2026

    @cipherstash-agent
    Author

    Plan change (2026-11-18): this is implemented inside the open stack instead of after the release, so no code is merged only to be replaced. It lands on #11's branch and is merged up the stack.


    Generated by Claude Code

  2. cipherstash-agent commented on Nov 18, 2026

    @cipherstash-agent
    Author

    Follow-up: #20 moves this step's code from the workflow file into a Python file the workflow checks out at its own commit (tickets #21–#27). Behaviour and tests stay the same; only where the code lives and how the tests find it change.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions