Skip to content

[AIDAPP-1662]: Add a Bruno collection for testing the API locally - #1700

Draft
Orrison wants to merge 2 commits into
mainfrom
AIDAPP-1662-bruno
Draft

Orrison wants to merge 2 commits into
mainfrom
AIDAPP-1662-bruno

Conversation

@Orrison

@Orrison Orrison commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Ticket(s) or GitHub Issue

Technical Description

First PR in the AIDAPP-1662 stack (REST API support for Advisories). This PR adds no PHP changes. It adds a shared Bruno collection so the API can be tested locally, and sets the expectation that it is kept up to date. Later PRs in the stack add the Advisory requests to it.

  • docs/bruno/: the "Aiding App API" collection in OpenCollection YAML format, containing the existing Organizations and Contacts requests (from AIDAPP-1639 / AIDAPP-1640).
    • The collection sets Bearer {{apiKey}} auth and Accept: application/json for every request. Folders set auth: inherit, because a folder with no auth setting defaults to "No Auth" in Bruno.
    • Only the Local environment (https://test.aidingapp.local) is committed. apiKey is a secret variable, so Bruno stores its value on the developer's machine and never in the repo. Because the repo is public, no hosted-instance URLs are included.
    • Each folder's requests run in order: create, view, update, then archive. Created IDs are passed between requests through runtime variables, so running the collection with the Runner tests every endpoint end to end and cleans up after itself.
  • docs/how-tos/test-the-api-with-bruno.md: how to open the collection, configure the Local environment and an API key, run requests, and add requests for new or changed endpoints.
  • .ai/rules/api.md (and its row in .ai/rules/index.md): a rule that API endpoint changes must update the Bruno collection in the same PR.
  • .prettierignore: excludes docs/bruno/. Prettier reformats YAML to 4-space indents, while Bruno rewrites files with 2 spaces whenever a request is saved, which would otherwise fail the formatting check after any edit made in Bruno.

Tested by opening the collection in Bruno and running it end to end with the Runner against a local tenant.

Any deployment steps required?

No

Cleanup Tasks

N/A


Before contributing and submitting this PR, make sure you have Read, agree, and are compliant with the contributing guidelines.

@Orrison Orrison added the Change Type | Documentation Improvements or additions to documentation label Nov 6, 2026
@Orrison Orrison changed the title AIDAPP 1662 bruno [AIDAPP-1662]: Add a Bruno collection for testing the API locally Nov 6, 2026
@canyon-gbs-automation
canyon-gbs-automation Bot requested a balanced review from Copilot November 6, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Failed creation retries retain stale organization and contact IDs, allowing subsequent Update or Archive requests to modify records from earlier successful attempts.

1 open issue
What changed in this PR

Adds a shared Bruno collection for locally testing the existing REST API, laying the groundwork for Advisory requests in later PRs. No PHP behavior changes are included.

Changes:

  • Adds Organization and Contact requests with inherited authentication, status assertions, and runtime-variable chaining.
  • Documents local setup, secret handling, and collection maintenance.
  • Requires API changes to update the collection and preserves Bruno’s native formatting.
File Description
docs/​how-tos/​test-the-api-with-bruno.md Documents setup, execution, and contribution steps.
docs/​bruno/​Organizations/​View Organization.yml Retrieves an organization by runtime ID.
docs/​bruno/​Organizations/​Update Organization.yml Exercises partial organization updates.
docs/​bruno/​Organizations/​List Organizations.yml Provides pagination, sorting, and filter examples.
docs/​bruno/​Organizations/​folder.yml Sets folder order and inherited authentication.
docs/​bruno/​Organizations/​Create Organization.yml Creates sample organizations and captures runtime variables.
docs/​bruno/​Organizations/​Archive Organization.yml Archives organizations and clears runtime variables.
docs/​bruno/​opencollection.yml Defines shared authentication, headers, and collection guidance.
docs/​bruno/​environments/​Local.yml Supplies local defaults and a secret API-key variable.
docs/​bruno/​Contacts/​View Contact.yml Retrieves a contact by runtime ID.
docs/​bruno/​Contacts/​Update Contact.yml Exercises partial contact updates.
docs/​bruno/​Contacts/​List Contacts.yml Provides pagination, sorting, and filter examples.
docs/​bruno/​Contacts/​folder.yml Sets folder order and inherited authentication.
docs/​bruno/​Contacts/​Create Contact.yml Creates sample contacts with optional organization linking.
docs/​bruno/​Contacts/​Archive Contact.yml Archives contacts and clears the runtime ID.
.prettierignore Excludes Bruno-managed YAML from formatting.
.ai/​rules/​index.md Maps API controllers to the maintenance rule.
.ai/​rules/​api.md Requires collection updates alongside API changes.

Review effort: Balanced

Comment on lines +43 to +44
// Organization names and domains must be unique, so each run uses a fresh suffix.
bru.setVar('exampleSuffix', Date.now().toString());

This branch has not been deployed

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

Labels

Change Type | Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants