Skip to content

Commit

Permalink
Fixed project names containing uppercase letters cannot be deployed (#…
Browse files Browse the repository at this point in the history
…2669)

* Fixed project names containing uppercase letters cannot be deployed

* cli delete project
  • Loading branch information
yoozo authored Feb 10, 2025
1 parent 995085d commit 1e365ad
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Project names containing uppercase letters cannot be deployed.

## [5.5.1] - 2025-02-04
### Changed
- Update copyright header to 2025
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/controller/deploy-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jest.setTimeout(120000);

const projectSpec = {
org: process.env.SUBQL_ORG_TEST!,
projectName: 'mockedstarter',
projectName: 'mockedStarter',
ipfs: 'Qmdr4yg98Fv8Yif3anjKVHhjuAKR665j6ekhWsfYUdkaCu',
subtitle: 'This project is generated by SubQuery SDK integration tests',
description: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/controller/deploy-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export async function projectsInfo(
url: string,
type: string
): Promise<ProjectDataType | undefined> {
const key = `${org}/${projectName}`;
const key = `${org}/${projectName.toLowerCase()}`;
try {
const res = await getAxiosInstance(url, authToken).get<ProjectDataType[]>(
`v3/subqueries/${buildProjectKey(org, projectName)}/deployments`
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/controller/project-controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {createProject, deleteProject} from './project-controller';

const projectSpec = {
org: process.env.SUBQL_ORG_TEST,
projectName: 'mocked_project',
projectName: 'mocked_Project',
ipfs: 'QmaVh8DGzuRCJZ5zYEDxXQsXYqP9HihjjeuxNNteSDq8xX',
subtitle: '',
description: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/controller/project-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function deleteProject(
project_name: string,
url: string
): Promise<string> {
const key = `${organization}/${project_name}`;
const key = `${organization}/${project_name.toLowerCase()}`;
try {
await axios({
headers: {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function errorHandle(e: any, msg: string): Error {
}

export function buildProjectKey(org: string, projectName: string): string {
return encodeURIComponent(`${org}/${projectName}`);
return encodeURIComponent(`${org}/${projectName.toLowerCase()}`);
}

export async function renderTemplate(templatePath: string, outputPath: string, templateData: ejs.Data): Promise<void> {
Expand Down

0 comments on commit 1e365ad

Please sign in to comment.