Skip to content

feat: ai actions and feedback#1012

Merged
AbhishekA1509 merged 7 commits intofix/ai-fixesfrom
feat/ai-actions-and-feedback
Feb 17, 2026
Merged

feat: ai actions and feedback#1012
AbhishekA1509 merged 7 commits intofix/ai-fixesfrom
feat/ai-actions-and-feedback

Conversation

@AbhishekA1509
Copy link
Copy Markdown
Member

@AbhishekA1509 AbhishekA1509 commented Feb 10, 2026

Description

This pull request introduces several improvements and new features to the common library, focusing on validation utilities, API enhancements, and UI component flexibility. The most important changes are the addition of app name validation, new minimal API endpoints for Docker registries and Git providers, and updates to the main context for easier integration of custom UI components.

Validation enhancements:

  • Added validateAppName function for app name validation, enforcing minimum/maximum length, allowed characters, and format requirements.
  • Introduced a new regular expression pattern for app names in PATTERNS.APP_NAME within Constants.ts.

API improvements:

  • Added getDockerRegistriesListMin and getGitProvidersListMin functions to Common.service.ts for fetching minimal lists of Docker registries and Git providers.
  • Registered new API routes DOCKER_REGISTRY_MIN and GIT_PROVIDER_MIN in Constants.ts.

UI component flexibility:

  • Updated MainContext type to include an optional AskDevtronButton component, allowing easier injection of custom UI elements. [1] [2]
  • Refactored PageHeader.tsx to use the new AskDevtronButton prop for rendering the Ask Devtron AI button, improving maintainability and customization. [1] [2] [3]

Other changes:

  • Bumped package version to 1.22.8-beta-5 in package.json.
  • Exported getProjectOptions from useGetResourceKindsOptions for easier consumption.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copilot AI review requested due to automatic review settings February 10, 2026 07:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces new AI-related UI extensibility via MainContext (injectable Ask Devtron button), adds lightweight “min” autocomplete APIs for Git providers and Docker registries, and adds app-name validation utilities to support these flows in the shared FE common library.

Changes:

  • Added validateAppName and introduced an APP_NAME pattern in shared constants.
  • Extended MainContext to optionally provide an AskDevtronButton and updated PageHeader to render it when applicable.
  • Added new minimal-list service calls + routes (git/provider/autocomplete, docker/registry/autocomplete) and exported getProjectOptions from the resource-kinds hook package.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Shared/validations.tsx Adds validateAppName validation helper.
src/Common/Constants.ts Adds PATTERNS.APP_NAME and new autocomplete routes.
src/Shared/Providers/MainContextProvider/types.ts Extends MainContext with optional AskDevtronButton.
src/Shared/Components/Header/PageHeader.tsx Uses AskDevtronButton from context instead of inline Ask-AI button logic.
src/Common/Common.service.ts Adds “min list” service calls for registries and git providers.
src/Shared/Hooks/useGetResourceKindsOptions/index.ts Re-exports getProjectOptions from service.
package.json / package-lock.json Bumps package version to 1.22.8-beta-5.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Common/Constants.ts

export const PATTERNS = {
STRING: /^[a-zA-Z0-9_]+$/,
APP_NAME: '^[a-z][a-z0-9-]*[a-z0-9]$/*',
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

PATTERNS.APP_NAME is currently a string (while almost all other PATTERNS entries are RegExps) and it also contains a trailing $/*, which looks unintentional. This mixed typing makes PATTERNS easy to misuse elsewhere (e.g., calling .test on APP_NAME would throw) and the extra /* is confusing. Consider making APP_NAME a RegExp like the other patterns (and remove the trailing /*).

Suggested change
APP_NAME: '^[a-z][a-z0-9-]*[a-z0-9]$/*',
APP_NAME: /^[a-z][a-z0-9-]*[a-z0-9]$/,

Copilot uses AI. Check for mistakes.
@AbhishekA1509 AbhishekA1509 self-assigned this Feb 17, 2026
@AbhishekA1509 AbhishekA1509 merged commit b07ed17 into fix/ai-fixes Feb 17, 2026
4 checks passed
@AbhishekA1509 AbhishekA1509 deleted the feat/ai-actions-and-feedback branch February 17, 2026 09:08
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