Skip to content
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

feat(auth-api): Zendesk credentials #16162

Merged
merged 3 commits into from
Sep 26, 2024
Merged

feat(auth-api): Zendesk credentials #16162

merged 3 commits into from
Sep 26, 2024

Conversation

GunnlaugurG
Copy link
Member

@GunnlaugurG GunnlaugurG commented Sep 26, 2024

What

Zendesk credentials

Why

Specify why you need to achieve this

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features
    • Introduced configuration settings for integrating a Zendesk contact form, enhancing service capabilities.
    • Added support for environment-specific subdomains for the Zendesk contact form.
    • Implemented new secrets for secure access to the Zendesk contact form email and token.

@GunnlaugurG GunnlaugurG requested a review from a team as a code owner September 26, 2024 10:29
Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Walkthrough

The changes introduce new configuration settings for a Zendesk contact form across multiple files. Specifically, a constant for the Zendesk subdomain is added, along with two new secrets for email and token, enhancing the service's configuration capabilities for different environments (development, staging, and production).

Changes

File Change Summary
apps/services/auth/admin-api/infra/auth-admin-api.ts Added constant ZENDESK_CONTACT_FORM_SUBDOMAIN and secrets ZENDESK_CONTACT_FORM_EMAIL and ZENDESK_CONTACT_FORM_TOKEN.
charts/identity-server/values.dev.yaml Added environment variables ZENDESK_CONTACT_FORM_SUBDOMAIN, ZENDESK_CONTACT_FORM_EMAIL, and ZENDESK_CONTACT_FORM_TOKEN.
charts/identity-server/values.prod.yaml Added environment variables ZENDESK_CONTACT_FORM_SUBDOMAIN, ZENDESK_CONTACT_FORM_EMAIL, and ZENDESK_CONTACT_FORM_TOKEN.
charts/identity-server/values.staging.yaml Added environment variables ZENDESK_CONTACT_FORM_SUBDOMAIN, ZENDESK_CONTACT_FORM_EMAIL, and ZENDESK_CONTACT_FORM_TOKEN.

Possibly related PRs

  • feat(auth-admin): Delegation reference id #15932: This PR adds a referenceId field to the delegation model, which is intended to facilitate referencing a Zendesk ID, directly connecting it to the changes made in the main PR that enhance Zendesk integration.

Suggested labels

automerge

Suggested reviewers

  • saevarma

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
apps/services/auth/admin-api/infra/auth-admin-api.ts (1)

75-76: LGTM! Consider updating documentation for new Zendesk integration.

The addition of Zendesk-related secrets (ZENDESK_CONTACT_FORM_EMAIL and ZENDESK_CONTACT_FORM_TOKEN) follows the existing pattern for secret management and adheres to best practices by using Kubernetes secrets.

Consider updating the project documentation to reflect the new Zendesk integration, including any necessary setup steps for these new secrets in the Kubernetes environment.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5828cef and 0d4079c.

📒 Files selected for processing (1)
  • apps/services/auth/admin-api/infra/auth-admin-api.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/services/auth/admin-api/infra/auth-admin-api.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (2)
apps/services/auth/admin-api/infra/auth-admin-api.ts (2)

68-76: Summary: Zendesk integration looks good, with minor suggestions.

The changes introduce Zendesk-related configurations in line with the PR objectives. The implementation adheres to NestJS architecture, dependency injection patterns, and follows existing conventions for environment-specific configurations and secret management.

Key points:

  1. Zendesk subdomain configuration added (same for all environments).
  2. Zendesk-related secrets properly managed using Kubernetes.

Suggestions:

  1. Verify the intention of using the same Zendesk subdomain across all environments.
  2. Update project documentation to reflect the new Zendesk integration.

Overall, the changes are well-implemented and ready for merge, pending the minor verifications and documentation updates suggested above.


68-72: Verify the intention of using the same Zendesk subdomain for all environments.

The ZENDESK_CONTACT_FORM_SUBDOMAIN is set to 'digitaliceland' for all environments (prod, staging, and dev). While this follows the existing pattern for environment-specific configurations, it's worth confirming if this is intentional or if different subdomains should be used for different environments.

✅ Verification successful

Zendesk subdomains are consistently set across all environments.

The ZENDESK_CONTACT_FORM_SUBDOMAIN is set to 'digitaliceland' for production, staging, and development environments. This uniform configuration suggests that using the same subdomain across all environments is intentional.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other Zendesk-related configurations use different values per environment

# Test: Search for other Zendesk-related configurations
rg --type typescript 'ZENDESK_' apps/services/auth/admin-api/infra/

Length of output: 102


Script:

#!/bin/bash
# Description: Check if other Zendesk-related configurations use different values per environment

# Test: Search for other Zendesk-related configurations
rg --type ts 'ZENDESK_' apps/services/auth/admin-api/infra/

Length of output: 404

Copy link
Member

@brynjarorng brynjarorng left a comment

Choose a reason for hiding this comment

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

LGTM

@GunnlaugurG GunnlaugurG added the automerge Merge this PR as soon as all checks pass label Sep 26, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (4)
charts/identity-server/values.prod.yaml (2)

238-238: LGTM! Zendesk integration looks good.

The addition of Zendesk-related environment variables is well-implemented:

  1. Using a hardcoded subdomain for production is appropriate.
  2. Storing the email and token as Kubernetes secrets is a good security practice.

One minor suggestion:

Consider adding a comment explaining the purpose of these Zendesk variables for better maintainability. For example:

# Zendesk contact form integration
ZENDESK_CONTACT_FORM_SUBDOMAIN: 'digitaliceland'
ZENDESK_CONTACT_FORM_EMAIL: '/k8s/api/ZENDESK_CONTACT_FORM_EMAIL'
ZENDESK_CONTACT_FORM_TOKEN: '/k8s/api/ZENDESK_CONTACT_FORM_TOKEN'

Also applies to: 296-297


238-238: Summary: Zendesk integration added successfully

The changes in this file are focused on adding Zendesk contact form integration to the services-auth-admin-api service. The implementation looks secure and appropriate for a production environment. These additions will enable the authentication API to interact with Zendesk, likely for handling user inquiries or support requests.

As this integration introduces a new external dependency, ensure that:

  1. The application code handles potential Zendesk API failures gracefully.
  2. Monitoring is in place to track the health and performance of this integration.
  3. Documentation is updated to reflect this new integration and its purpose in the system architecture.

Also applies to: 296-297

charts/identity-server/values.staging.yaml (1)

241-241: LGTM! Consider parameterizing the Zendesk subdomain for flexibility.

The addition of Zendesk-related environment variables is well-implemented:

  1. Using Kubernetes secrets for sensitive data (email and token) is a good security practice.
  2. The changes align with the PR objectives of introducing Zendesk credentials.

Consider parameterizing the ZENDESK_CONTACT_FORM_SUBDOMAIN value for better flexibility across different environments:

-    ZENDESK_CONTACT_FORM_SUBDOMAIN: 'digitaliceland'
+    ZENDESK_CONTACT_FORM_SUBDOMAIN: '{{ .Values.zendesk.subdomain }}'

This change would allow easier configuration changes in the future if needed.

Also applies to: 299-300

charts/identity-server/values.dev.yaml (1)

241-241: LGTM! Consider making the Zendesk subdomain configurable.

The addition of Zendesk-related environment variables is well-structured and follows good security practices by using Kubernetes secrets for sensitive information (email and token).

Consider making the ZENDESK_CONTACT_FORM_SUBDOMAIN configurable through a Kubernetes secret or environment-specific value, rather than hardcoding it. This would allow for easier management across different environments (e.g., development, staging, production). You could modify it as follows:

-    ZENDESK_CONTACT_FORM_SUBDOMAIN: 'digitaliceland'
+    ZENDESK_CONTACT_FORM_SUBDOMAIN: '/k8s/zendesk/CONTACT_FORM_SUBDOMAIN'

This change would make the configuration more flexible and consistent with how the email and token are handled.

Also applies to: 299-300

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0d4079c and f91289e.

📒 Files selected for processing (3)
  • charts/identity-server/values.dev.yaml (2 hunks)
  • charts/identity-server/values.prod.yaml (2 hunks)
  • charts/identity-server/values.staging.yaml (2 hunks)

@kodiakhq kodiakhq bot merged commit 102d8db into main Sep 26, 2024
27 checks passed
@kodiakhq kodiakhq bot deleted the feat/zendesk-cred branch September 26, 2024 11:04
thoreyjona pushed a commit that referenced this pull request Oct 2, 2024
* fix zendesk credentials

* chore: charts update dirty files

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants