Skip to content

Commit

Permalink
Release 04-02-2025 (#1686)
Browse files Browse the repository at this point in the history
<!--
Follow semantic-release guidelines for the PR title, which is used in
the changelog.

Title should follow the format `<type>(<scope>): <subject>`, where
- Type is one of:
build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|BREAKING
CHANGE
- Scope (optional) describes the place of the change (eg a particular
milestone) and is usually omitted
- subject should be a non-capitalized one-line description in present
imperative tense and not ending with a period

See
https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines
for more details.
-->

## Description
<!-- Short description of the pull request -->

## Motivation
<!-- Background on use case, changes needed -->

## Fixes
<!-- Please provide a list of the issues fixed by this PR -->

* Bug fixed (#X)

## Changes:
<!-- Please provide a list of the changes implemented by this PR -->

* changes made

## Tests included

- [ ] Included for each change/fix?
- [ ] Passing? <!-- Merge will not be approved unless tests pass -->

## Documentation
- [ ] swagger documentation updated (required for API changes)
- [ ] official documentation updated

### official documentation info
<!-- If you have updated the official documentation, please provide PR #
and URL of the updated pages -->
  • Loading branch information
Junjiequan authored Feb 4, 2025
2 parents a1e1b72 + 4c38744 commit ccdc40b
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
## Extract information about the dependencies being updated by a Dependabot-generated PR
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2.2.0
uses: dependabot/fetch-metadata@v2.3.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,27 @@ jobs:
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.WORKFLOW_DISPATCHER_APP_ID }}
private-key: ${{ secrets.WORKFLOW_DISPATCHER_APP_PRIVATE_KEY }}
repositories: scitacean

- name: Trigger test workflow in scitacean
uses: actions/github-script@v6
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'SciCatProject',
repo: 'scitacean',
workflow_id: 'test.yml',
ref: 'main',
inputs: {
"backend-version": "latest",
"python-version": "3.13",
"tox-env": "py313-full"
}
})
24 changes: 24 additions & 0 deletions .github/workflows/release-and-publish-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,30 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.WORKFLOW_DISPATCHER_APP_ID }}
private-key: ${{ secrets.WORKFLOW_DISPATCHER_APP_PRIVATE_KEY }}
repositories: scitacean

- name: Trigger test workflow in scitacean
uses: actions/github-script@v6
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'SciCatProject',
repo: 'scitacean',
workflow_id: 'test.yml',
ref: 'main',
inputs: {
"backend-version": "${{steps.tag_version.outputs.new_tag}}",
"python-version": "3.13",
"tox-env": "py313-full"
}
})
start-backend-export-swagger:
runs-on: ubuntu-latest
steps:
Expand Down
121 changes: 62 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"@nestjs/cli": "^11.0.1",
"@nestjs/schematics": "^10.0.1",
"@nestjs/testing": "^10.3.8",
"@stylistic/eslint-plugin": "^2.10.1",
"@stylistic/eslint-plugin": "^3.0.0",
"@types/bcrypt": "^5.0.0",
"@types/chai": "^5.0.0",
"@types/express": "^5.0.0",
Expand Down
5 changes: 5 additions & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export class FullFacetResponse implements IFullFacets {
[key: string]: object;
}

export class ProposalCountFilters {
@ApiPropertyOptional()
fields?: string;
}

export class CountApiResponse {
@ApiProperty({ type: Number })
count: number;
Expand Down
21 changes: 16 additions & 5 deletions src/datasets/datasets.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ export class DatasetsController {
@Req() request: Request,
@Headers() headers: Record<string, string>,
@Query(new FilterPipe()) queryFilter: { filter?: string },
) {
): Promise<OutputDatasetObsoleteDto[]> {
const mergedFilters = replaceLikeOperator(
this.updateMergedFiltersForList(
request,
Expand Down Expand Up @@ -944,7 +944,7 @@ export class DatasetsController {
}),
);
}
return outputDatasets;
return outputDatasets as OutputDatasetObsoleteDto[];
}

// GET /datasets/fullquery
Expand Down Expand Up @@ -979,7 +979,7 @@ export class DatasetsController {
async fullquery(
@Req() request: Request,
@Query() filters: { fields?: string; limits?: string },
) {
): Promise<OutputDatasetObsoleteDto[]> {
const user: JWTUser = request.user as JWTUser;
const fields: IDatasetFields = JSON.parse(filters.fields ?? "{}");

Expand Down Expand Up @@ -1008,9 +1008,16 @@ export class DatasetsController {
limits: JSON.parse(filters.limits ?? "{}"),
};

const results = await this.datasetsService.fullquery(parsedFilters);
const datasets = await this.datasetsService.fullquery(parsedFilters);
let outputDatasets: OutputDatasetObsoleteDto[] = [];

return results as OutputDatasetObsoleteDto[];
if (datasets && datasets.length > 0) {
outputDatasets = datasets.map((dataset) =>
this.convertCurrentToObsoleteSchema(dataset),
);
}

return outputDatasets as OutputDatasetObsoleteDto[];
}

// GET /fullfacets
Expand Down Expand Up @@ -1298,6 +1305,10 @@ export class DatasetsController {
isArray: false,
description: "Return dataset with pid specified",
})
@ApiResponse({
status: HttpStatus.NOT_FOUND,
description: "Dataset not found",
})
async findById(@Req() request: Request, @Param("pid") id: string) {
const dataset = this.convertCurrentToObsoleteSchema(
await this.checkPermissionsForDatasetObsolete(request, id),
Expand Down
Loading

0 comments on commit ccdc40b

Please sign in to comment.