Skip to content

feat: Add an integration subcommand for manipulating integrations#776

Merged
atheriel merged 1 commit into
mainfrom
aj-integration-subcommand
Jun 5, 2026
Merged

feat: Add an integration subcommand for manipulating integrations#776
atheriel merged 1 commit into
mainfrom
aj-integration-subcommand

Conversation

@atheriel

@atheriel atheriel commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Intent

This commit adds a suite of CLI commands for managing "OAuth" integrations:

$ rsconnect integration list
$ rsconnect integration show GUID
$ rsconnect integration add --template <key> [-N name] [-C key=value ...]
$ rsconnect integration edit GUID [-N name] [-C key=value ...]
$ rsconnect integration remove GUID
$ rsconnect integration templates list
$ rsconnect integration templates show --key <key>

The edit command merges --config fields with the existing config (fetching it only when config changes are requested), so users only need to specify fields they want to change.

ACLs can be passed via --allow-user and --allow-group.

Unit tests are included, as is autogenerated documentation.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Automated Tests

Unit tests are included. I also did a bunch of ad-hoc testing against a local Connect instance.

Directions for Reviewers

This is a pretty self-contained change, so the risk is low. To test it manually, try some of these out:

# Create
$ rsconnect integration add \
    -s https://connect.example.com -k $CONNECT_API_KEY \
    --template databricks \
    -N "Databricks Prod" \
    -C workspace_host=https://dbc-abc123.cloud.databricks.com \
    -C client_id=my-databricks-client \
    -C client_secret=my-databricks-secret

# Rename
$ rsconnect integration edit \
    -s https://connect.example.com -k $CONNECT_API_KEY \
    $INTEGRATION_GUID \
    -N "Databricks (Production)"

# Update
$ rsconnect integration edit \
    -s https://connect.example.com -k $CONNECT_API_KEY \
    $INTEGRATION_GUID \
    -C client_secret=my-new-databricks-secret

# Delete
$ rsconnect integration remove \
    -s https://connect.example.com -k $CONNECT_API_KEY \
    $INTEGRATION_GUID

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.
  • I have run the rsconnect-python-tests-at-night workflow in Connect against this feature branch.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-05 00:48 UTC

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6941 5569 80% 0% 🟢

New Files

File Coverage Status
rsconnect/actions_integration.py 88% 🟢
TOTAL 88% 🟢

Modified Files

File Coverage Status
rsconnect/api.py 79% 🟢
rsconnect/main.py 78% 🟢
rsconnect/models.py 93% 🟢
TOTAL 83% 🟢

updated for commit: d3574e6 by action🐍

@edavidaja edavidaja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Similar to #778, integration list and integration templates list dump an overwhelming amount of json that should probably be reserved for integration show and integration template show
  • the meaning of "the template key" in integrations template show is not obvious
  • STRIPPEDSTRING shows up as a type in a few places and I don't know what it means, really

@atheriel atheriel force-pushed the aj-integration-subcommand branch 2 times, most recently from 0586f04 to 2a30664 Compare June 3, 2026 20:00
@atheriel

atheriel commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

The STRIPPEDSTRING thing appears to be intentional and predates these changes, but otherwise: all fixed.

@atheriel atheriel requested a review from edavidaja June 3, 2026 20:58
This commit adds a suite of CLI commands for managing "OAuth"
integrations:

    $ rsconnect integration list
    $ rsconnect integration show GUID
    $ rsconnect integration add --template <key> [-N name] [-C key=value ...]
    $ rsconnect integration edit GUID [-N name] [-C key=value ...]
    $ rsconnect integration remove GUID
    $ rsconnect integration templates list
    $ rsconnect integration templates show --key <key>

The `edit` command merges `--config` fields with the existing
config (fetching it only when config changes are requested), so users
only need to specify fields they want to change.

ACLs can be passed via `--allow-user` and `--allow-group`.

Unit tests are included, as is autogenerated documentation.

Signed-off-by: Aaron Jacobs <aaron.jacobs@posit.co>
@atheriel atheriel force-pushed the aj-integration-subcommand branch from 2a30664 to d3574e6 Compare June 5, 2026 00:38
@atheriel atheriel merged commit b28aa50 into main Jun 5, 2026
24 checks passed
@atheriel atheriel deleted the aj-integration-subcommand branch June 5, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants