- 
                Notifications
    
You must be signed in to change notification settings  - Fork 83
 
feat: add atx fes integration for transform profiles #2439
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
base: main
Are you sure you want to change the base?
Conversation
          Codecov Report❌ Patch coverage is  Additional details and impacted files@@            Coverage Diff             @@
##             main    #2439      +/-   ##
==========================================
- Coverage   62.42%   62.09%   -0.33%     
==========================================
  Files         266      271       +5     
  Lines       59107    60507    +1400     
  Branches     3790     3841      +51     
==========================================
+ Hits        36895    37574     +679     
- Misses      22137    22857     +720     
- Partials       75       76       +1     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
| 
               | 
          ||
| // Initialize ATX FES client | ||
| this.atxClient = new ElasticGumbyFrontendClient({ | ||
| region: 'us-east-1', | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this region be dynamic? for example- if user has profile in FRA do we override client region somewhere else?
| 
               | 
          ||
| return true | ||
| } catch (error) { | ||
| this.logging.error(`TransformConfigurationServer: Failed to initialize ATX client: ${error}`) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets log url and region also here. in case of errors, it will help us investigate
| 
               | 
          ||
| return transformProfiles | ||
| } catch (error) { | ||
| this.logging.error(`TransformConfigurationServer: ListAvailableProfiles failed: ${error}`) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be warning?
| const endpoint = process.env.TCP_ENDPOINT || DEFAULT_ATX_FES_ENDPOINT_URL | ||
| 
               | 
          ||
| this.atxClient = new ElasticGumbyFrontendClient({ | ||
| region: 'us-east-1', | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be dynamic? or if we need us-east-1 only, can we please create constant for that and use it here.
| 
               | 
          ||
| return true | ||
| } catch (error) { | ||
| this.logging.log(`ATX FES Client: Failed to initialize: ${error}`) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets log region and end point here
| */ | ||
| private async addAuthToCommand(command: any): Promise<void> { | ||
| if (!this.serviceManager.isReady()) { | ||
| throw new Error('ATX Token Service Manager not ready') | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is user facing error, lets reword it with customer facing verbs
| result.forEach((settledResult, index) => { | ||
| const [region, endpoint] = Array.from(endpoints.entries())[index] | ||
| if (settledResult.status === 'fulfilled') { | ||
| const profiles = settledResult.value | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not using this profiles value anywhere. can we delete this?
| /** | ||
| * Clear cached applicationUrl (for token refresh scenarios) | ||
| */ | ||
| clearApplicationUrlCache(): void { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is never called. for new config we should clear cache.
| 
               | 
          ||
| export const TransformConfigurationServerTokenProxy = TransformConfigurationServerToken() | ||
| 
               | 
          ||
| export const ATXHandlerServerTokenProxy = AtxNetTransformServerToken() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is same as AtxNetTransformServerTokenProxy() can we remove duplicate
| Server, | ||
| } from '@aws/language-server-runtimes/server-interface' | ||
| import { AtxTokenServiceManager } from '../../shared/amazonQServiceManager/AtxTokenServiceManager' | ||
| import { ATXTransformHandler } from './atxTransformHandler' | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:nit non-blocking. some variables use Atx and some use ATX. can we use only one convention
| export const ATX_FES_ENDPOINTS = new Map([['us-east-1', 'https://api.transform-gamma.us-east-1.on.aws/']]) | ||
| 
               | 
          ||
| export const DEFAULT_ATX_FES_ENDPOINT_URL = 'https://api.transform-gamma.us-east-1.on.aws/' | ||
| export const DEFAULT_ATX_FES_REGION = 'us-east-1' | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not using this, can we update string usage of us-east-1 to this?
| @@ -0,0 +1,93 @@ | |||
| import { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add unit tests for this new class.
Summary
Implements ATX FES (Amazon Transform Frontend Service) integration to support Transform profiles alongside existing Q Developer profiles.
Changes
AtxTokenServiceManagerATXTransformHandlerfor ATX FES API calls (ListAvailableProfiles)AtxNetTransformServerfor Transform-specific LSP commandsTransformConfigurationServerfor "aws.transformProfiles" configuration sectioncore/atx-fes-client/following repo patternsArchitecture
Dependencies
@amazon/elastic-gumby-frontend-clientincore/atx-fes-client/bundleDependenciesto include ATX FES clientTesting
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.