Skip to content
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

BC-3961-move-s3-client-to-infra #4369

Merged
merged 10 commits into from
Sep 1, 2023
Merged

Conversation

SevenWaysDP
Copy link
Contributor

@SevenWaysDP SevenWaysDP commented Aug 30, 2023

Description

Links to Tickets or other pull requests

Changes

Datasecurity

Deployment

New Repos, NPM pakages or vendor scripts

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

imports: [LoggerModule],
providers: [S3ClientAdapter],
})
export class S3FileStorageModule {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ist vom Namen schwer von dem FileStorageModule zu unterscheiden oder? Ist es das FileStorageClientModule?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ich finde S3 sollte schon im Namen auftauchen, weil es ja dafür spezifisch ist. Vielleicht "S3ClientModule"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • FileStorageClientModule ist schon vergeben.
  • S3ClientModule habe ich übernommen

apps/server/src/modules/files-storage/helper/path.ts Outdated Show resolved Hide resolved
const expectedResponse = FileResponseBuilder.build(fileResponse, fileRecord.getName());

spy = jest.spyOn(service, 'downloadFile').mockResolvedValueOnce(fileResponse);
spy = jest.spyOn(service, 'downloadFile').mockResolvedValueOnce(expectedResponse);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ist das hier richtig so? fileResponse wird nicht mehr benutzt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mapping passiert jetzt dort

public async downloadFile(schoolId: EntityId, fileRecordId: EntityId, bytesRange?: string): Promise<IGetFile> {
const pathToFile = createPath(schoolId, fileRecordId);
const response = await this.storageClient.get(pathToFile, bytesRange);
public async downloadFile(fileRecord: FileRecord, bytesRange?: string): Promise<GetFileResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Die beiden Methoden downloadFile und download machen doch jetzt das gleiche. Du könntest download einfach rausschmeißen und die bisherigen Aufrufe auf downloadFile ändern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nein, werden für verschiedene use cases benutzt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Und ich mache kein Refactoring in dem PR! Wobei mir schon paar stellen aufgefallen die ich gerne refactorn würde

Copy link
Contributor

Choose a reason for hiding this comment

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

Naja, die Signatur zu ändern, ist eigentlich auch ein Refactoring, halt nur ein kleineres... aber okay...

@sonarcloud
Copy link

sonarcloud bot commented Sep 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@SevenWaysDP SevenWaysDP merged commit 82adf21 into main Sep 1, 2023
43 checks passed
@SevenWaysDP SevenWaysDP deleted the BC-3961-move-s3-client-to-infra branch September 1, 2023 11:03
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.

3 participants