Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
solve issue with discriminator generating import doublon
…urn correct headers.Autorization
Add new tasks
292c096 to
afb3896
Compare
There was a problem hiding this comment.
Pull request overview
This PR performs a major refactoring of the CI pipeline and codebase structure for the Upsun SDK for Node.js. The changes include:
- Modernized CI/CD: New GitHub Actions workflows with better separation of concerns (quality, tests, doc, coverage, build)
- Renamed task classes: Changed from singular to plural naming (e.g.,
ActivityTask→ActivitiesTask,BackupTask→BackupsTask) - Updated configuration: Added Jest, ESLint, Prettier, and TypeScript test configuration
- Improved project structure: Better organization with new index files and separation of concerns
- Enhanced tooling: Updated npm scripts for better development workflow
Changes:
- Migrated from singular to plural naming for all task classes and test files
- Added comprehensive CI/CD workflows with quality checks, testing across multiple Node.js versions, and documentation generation
- Introduced OpenAPI Generator templates for better code generation
- Updated all import paths to reflect the new structure
- Added new configuration files for testing, linting, and formatting
Reviewed changes
Copilot reviewed 123 out of 128 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/develop.yml |
New PR review workflow with quality checks, tests, doc, and coverage |
.github/workflows/publish.yml |
Updated release workflow with documentation and coverage steps |
jest.config.js |
New Jest configuration with ESM support and coverage settings |
eslint.config.js |
New ESLint configuration using TypeScript ESLint |
tsconfig.test.json |
New TypeScript configuration for tests |
package.json |
Updated scripts for improved development workflow |
tests/unit/**/*.test.ts |
Renamed and updated test files (singular → plural) |
src/core/tasks/**/*.ts |
Renamed and refactored task files with plural naming |
src/core/tasks/task_base.ts |
Expanded validation methods |
src/core/index.ts |
Reorganized exports |
src/index.ts |
Simplified main entry point |
templates/**/*.mustache |
Added OpenAPI Generator templates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { | ||
| DedicatedDeploymentTargetCreateInputTypeEnum, | ||
| SubscriptionStatusEnum, | ||
| } from './model/index.js'; |
There was a problem hiding this comment.
Unused imports DedicatedDeploymentTargetCreateInputTypeEnum, SubscriptionStatusEnum.
| import { | |
| DedicatedDeploymentTargetCreateInputTypeEnum, | |
| SubscriptionStatusEnum, | |
| } from './model/index.js'; |
| } from './model/index.js'; | ||
| import { UpsunClient, UpsunConfig } from './upsun.js'; | ||
| import dotenv from 'dotenv'; | ||
| import { ResponseError } from './index.js'; |
There was a problem hiding this comment.
Unused import ResponseError.
| import { ResponseError } from './index.js'; |
| function delay(ms: number): Promise<void> { | ||
| return new Promise(resolve => setTimeout(resolve, ms)); | ||
| } | ||
|
|
There was a problem hiding this comment.
Unused function delay.
| function delay(ms: number): Promise<void> { | |
| return new Promise(resolve => setTimeout(resolve, ms)); | |
| } |
src/app.ts
Outdated
| const orgName = "Perso-home"; // Replace with your organization ID | ||
| const org = orgs.items?.find((p) => p.label === orgName) ?? null; | ||
| console.log(org); | ||
| const relationships = await upsun.environments.getDeployment(projectTestId, 'main', 'current'); |
There was a problem hiding this comment.
Unused variable relationships.
| const relationships = await upsun.environments.getDeployment(projectTestId, 'main', 'current'); | |
| await upsun.environments.getDeployment(projectTestId, 'main', 'current'); |
src/app.ts
Outdated
| const mountsWebapps = await upsun.mounts.list( | ||
| projectTestId, | ||
| 'main', | ||
| DeploymentResourceGroup.webapps, | ||
| ); |
There was a problem hiding this comment.
Unused variable mountsWebapps.
| const mountsWebapps = await upsun.mounts.list( | |
| projectTestId, | |
| 'main', | |
| DeploymentResourceGroup.webapps, | |
| ); |
| console.log(res); | ||
|
|
||
| console.log('--- Set Resources ---'); | ||
| const response = await upsun.resources.set( |
There was a problem hiding this comment.
Unused variable response.
| const response = await upsun.resources.set( | |
| await upsun.resources.set( |
| import { | ||
| AcceptedResponse, | ||
| Activity, | ||
| CanCreateNewOrgSubscription200Response, | ||
| EnvironmentVariableCreateInput, | ||
| Project, | ||
| ProjectCapabilities, | ||
| ProjectPatch, | ||
| ProjectSettings, | ||
| ProjectVariable, | ||
| Subscription, | ||
| Blob, | ||
| Commit, | ||
| Ref, | ||
| Tree, | ||
| SystemInformation, | ||
| Domain, | ||
| Certificate, | ||
| TeamProjectAccess, | ||
| GrantProjectTeamAccessRequestInner, | ||
| GrantTeamProjectAccessRequestInner, | ||
| ListProjectTeamAccess200Response, | ||
| DomainPatch, | ||
| UserProjectAccess, | ||
| GrantProjectUserAccessRequestInner, | ||
| ListProjectUserAccess200Response, | ||
| Environment, | ||
| ProjectInvitation, | ||
| ListOrgProjects200Response, | ||
| } from '../../model/index.js'; |
There was a problem hiding this comment.
Unused imports Blob, Commit, Ref, SystemInformation, Tree.
src/core/tasks/repositories.ts
Outdated
| @@ -0,0 +1,121 @@ | |||
| import { UpsunClient } from '../../upsun.js'; | |||
| import { Blob, Commit, Metrics, Ref, SystemInformation, Tree } from '../../model/index.js'; | |||
There was a problem hiding this comment.
Unused import Metrics.
| import { | ||
| AddOnsApi, | ||
| ApiTokensApi, | ||
| AutoscalingApi, | ||
| CertManagementApi, | ||
| ConnectionsApi, | ||
| DeploymentApi, | ||
| DeploymentTargetApi, | ||
| DomainManagementApi, | ||
| EnvironmentActivityApi, | ||
| EnvironmentApi, | ||
| EnvironmentBackupsApi, | ||
| EnvironmentTypeApi, | ||
| EnvironmentVariablesApi, | ||
| GrantsApi, | ||
| Integrations, | ||
| InvoicesApi, | ||
| MfaApi, | ||
| OrdersApi, | ||
| OrganizationInvitationsApi, | ||
| OrganizationMembersApi, | ||
| OrganizationProjectsApi, | ||
| OrganizationsApi, | ||
| PhoneNumberApi, | ||
| ProfilesApi, | ||
| ProjectActivityApi, | ||
| ProjectApi, | ||
| ProjectInvitationsApi, | ||
| ProjectSettingsApi, | ||
| ProjectVariablesApi, | ||
| RecordsApi, | ||
| RepositoryApi, | ||
| RoutingApi, | ||
| RuntimeOperationsApi, | ||
| SourceOperationsApi, | ||
| SshKeysApi, | ||
| SubscriptionsApi, | ||
| SystemInformationApi, | ||
| TeamAccessApi, | ||
| TeamsApi, | ||
| ThirdPartyIntegrationsApi, | ||
| UserAccessApi, | ||
| UserProfilesApi, | ||
| UsersApi, | ||
| VouchersApi, | ||
| } from './index.js'; |
There was a problem hiding this comment.
Unused imports DeploymentTargetApi, Integrations.
src/core/oauth-provider.ts
Outdated
|
|
||
| if (!response.ok) { | ||
| throw new Error('Token exchange failed'); | ||
| return false; |
There was a problem hiding this comment.
This statement is unreachable.
| return false; |
ab42d67 to
92244d4
Compare
No description provided.