-
Notifications
You must be signed in to change notification settings - Fork 1
[CXH-1585] feat: account provisioning + enable/disable user actions via Retool REST API #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sergiocorral-conductorone
merged 8 commits into
main
from
sergiocorral/cxh-1585-retool-add-account-provisioning-and-deprovisioning
Jun 24, 2026
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
426ecaf
feat: add account provisioning/deprovisioning via Retool REST API (CX…
sergiocorral-conductorone d007839
test: add scheduled integration-test workflow (Retool in Docker)
sergiocorral-conductorone 0b5f60e
fix: address lint (bodyclose) and PR review suggestions
sergiocorral-conductorone 3122f6a
chore: upgrade baton-sdk to v0.13.0, use WithIsSecret for the API token
sergiocorral-conductorone 515229e
ci: run the Retool integration test on every PR
sergiocorral-conductorone a7f2608
ci: migrate golangci-lint to v2 (required by Go 1.25)
sergiocorral-conductorone 161c71d
feat: replace account Delete with enable_user/disable_user actions
sergiocorral-conductorone 1308d9f
fix: address PR review feedback (CXH-1585)
sergiocorral-conductorone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: integration-test | ||
|
|
||
| # baton-retool can't be exercised with a simple mock: sync + group/page provisioning | ||
| # need Retool's internal Postgres, and account provisioning needs the Retool REST API. | ||
| # This job stands up a throwaway self-hosted Retool (postgres + jobs-runner + api) via | ||
| # Docker, seeds an admin/org, mints a REST token, then runs sync + grant/revoke + | ||
| # account provisioning against it. It's heavy (image pull + DB migrations), so it runs | ||
| # on a schedule and on demand rather than on every PR. | ||
| on: | ||
| schedule: | ||
| - cron: '0 7 * * 1' # Mondays 07:00 UTC | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| integration-test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| RETOOL_VERSION: 3.334.17-stable | ||
| ADMIN_EMAIL: admin@example.com | ||
| ADMIN_PASSWORD: BatonCITest123! | ||
| BATON_LOG_LEVEL: info | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Build baton-retool | ||
| run: go build -o baton-retool ./cmd/baton-retool | ||
|
|
||
| - name: Generate Retool env (throwaway secrets for the ephemeral DB) | ||
| working-directory: test/integration | ||
| run: | | ||
| cat > docker.env <<EOF | ||
| DEPLOYMENT_TEMPLATE_TYPE=docker-compose | ||
| POSTGRES_HOST=postgres | ||
| POSTGRES_DB=hammerhead_production | ||
| POSTGRES_PORT=5432 | ||
| POSTGRES_USER=retool_internal_user | ||
| POSTGRES_PASSWORD=$(openssl rand -hex 24) | ||
| JWT_SECRET=$(openssl rand -hex 64) | ||
| ENCRYPTION_KEY=$(openssl rand -hex 24) | ||
| LICENSE_KEY=EXPIRED-LICENSE-KEY-TRIAL | ||
| COOKIE_INSECURE=true | ||
| IGNORE_CODE_EXECUTOR_STARTUP_CHECK=true | ||
| DOMAINS=localhost -> http://api:3000 | ||
| BASE_DOMAIN=http://localhost:3000 | ||
| WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_HOST=temporal | ||
| WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_PORT=7233 | ||
| EOF | ||
|
|
||
| - name: Start Retool stack | ||
| working-directory: test/integration | ||
| run: docker compose up -d | ||
|
|
||
| - name: Wait for Retool, seed admin, mint API token | ||
| run: | | ||
| TOKEN=$(bash test/integration/setup.sh) | ||
| PGPW=$(grep '^POSTGRES_PASSWORD=' test/integration/docker.env | cut -d= -f2-) | ||
| { | ||
| echo "BATON_RETOOL_API_TOKEN=$TOKEN" | ||
| echo "BATON_RETOOL_API_BASE_URL=http://localhost:3000" | ||
| echo "BATON_CONNECTION_STRING=user=retool_internal_user password=$PGPW host=localhost port=5432 dbname=hammerhead_production sslmode=disable" | ||
| } >> "$GITHUB_ENV" | ||
|
|
||
| - name: Download Baton | ||
| uses: ConductorOne/github-workflows/actions/get-baton@v2 | ||
|
|
||
| - name: Run sync | ||
| run: ./baton-retool | ||
|
|
||
| - name: Grant/Revoke group membership | ||
| uses: ConductorOne/github-workflows/actions/sync-test@v4 | ||
| with: | ||
| connector: ./baton-retool | ||
| baton-entitlement: 'group:g2:member' | ||
| baton-principal: 'u1' | ||
| baton-principal-type: user | ||
|
|
||
| - name: Account provisioning (create -> delete -> dup-delete) | ||
| run: bash test/integration/provisioning-test.sh | ||
|
|
||
| - name: Dump Retool logs on failure | ||
| if: failure() | ||
| working-directory: test/integration | ||
| run: docker compose logs --no-color --tail 200 | ||
|
|
||
| - name: Tear down | ||
| if: always() | ||
| working-directory: test/integration | ||
| run: docker compose down -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.