Skip to content

fix(admin): render social provider results, accept keys - #667

Merged
pcfreak30 merged 1 commit into
developfrom
fix/admin-social-provider-cli-render
Sep 2, 2026
Merged

fix(admin): render social provider results, accept keys#667
pcfreak30 merged 1 commit into
developfrom
fix/admin-social-provider-cli-render

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Adds render cases for the admin social-provider operations so social-providers create/get/update/enable/disable print the returned provider (human field group and JSON) instead of failing with an unroutable result type after the API call succeeds; delete gets the same treatment for its human output.

Resolves a non-numeric positional across the social-provider get/update/delete/enable/disable operations by matching the provider key (for example google) against the configured provider list, mirroring the platform-domain name lookup. Unmatched keys produce an error pointing to social-providers list rather than a bare 400 from the backend.

Adds tests for the provider and delete renderings in both output modes and for key resolution.


This pull request fixes the admin CLI rendering for social provider operations and adds support for resolving social provider identifiers by their provider key (e.g., "google") in addition to numeric IDs.

Changes include:

  1. Rendering support for social provider results (internal/cli/catalog_admin_wiring.go):

    • Added rendering cases for *admin.SocialProvider objects (returned by create, get, update, enable, and disable operations) and *catalogops.SocialProvidersDeleteResult objects (returned by delete operations).
    • Human-readable output displays provider details including ID, provider key, display name, enabled status, ordering, client ID, authentication/token/user URLs, scopes, and user attribute keys. JSON output is also supported.
    • Previously, these result types fell through to a default "unroutable result type" error, breaking all human-readable invocations of these commands.
  2. Provider key resolution (internal/cli/catalog_admin_wiring.go):

    • Added a resolveSocialProviderID function that allows operators to supply either a numeric record ID (passed through unchanged) or a provider key (e.g., "google") which is resolved by listing configured providers and matching on ProviderId.
    • Applied this resolution to the social provider get, update, delete, enable, and disable operations via a new switch case in the admin action adapter.
    • Errors clearly if the social provider service is not wired, and includes a helpful message pointing to the list command when a key is not found.
  3. Operation name constants (internal/catalogops/admin_social_providers.go):

    • Extracted social provider operation names into named constants (OpAdminSocialProvidersCreate, OpAdminSocialProvidersGet, OpAdminSocialProvidersUpdate, OpAdminSocialProvidersDelete, OpAdminSocialProvidersEnable, OpAdminSocialProvidersDisable) to keep them consistent with other operation constants used by the wiring layer.
  4. Test coverage (new file internal/cli/catalog_admin_social_providers_render_test.go):

    • Added tests verifying:
      • Social provider results render correctly as field groups in human-readable output.
      • JSON output for social provider results is correct.
      • Delete results render the confirmation message.
      • Numeric IDs pass through unchanged while unwired dependencies produce clear error messages for key-based resolution.

- add *admin.SocialProvider and SocialProvidersDeleteResult cases to
  renderAdminResult so create/get/update/enable/disable no longer fail
  with an unroutable result type
- resolve a non-numeric positional to a provider key (e.g. google) via
  the configured provider list, mirroring platform-domain name lookup
- add render and key-resolution tests
@kody-ai

kody-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@pcfreak30
pcfreak30 marked this pull request as ready for review September 2, 2026 21:27
@pcfreak30
pcfreak30 merged commit 55e84e6 into develop Sep 2, 2026
13 checks passed
@pcfreak30
pcfreak30 deleted the fix/admin-social-provider-cli-render branch September 2, 2026 21:29
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 50.1%

Generated from commit: 33a8245
Repository: LumeWeb/pinner-cli

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.

1 participant