-
Notifications
You must be signed in to change notification settings - Fork 17
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 5170 no preview for larger files #4457
Conversation
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.
api-configmap
api-secret
apps/server/src/modules/files-storage-client/service/files-storage.producer.ts
Show resolved
Hide resolved
ansible/roles/schulcloud-server-core/templates/amqp-preview-deployment.yml.j2
Outdated
Show resolved
Hide resolved
apps/server/src/modules/files-storage/controller/api-test/files-storage-copy-files.api.spec.ts
Outdated
Show resolved
Hide resolved
.../server/src/modules/files-storage/controller/api-test/files-storage-delete-files.api.spec.ts
Outdated
Show resolved
Hide resolved
...rver/src/modules/files-storage/controller/api-test/files-storage-download-upload.api.spec.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/files-storage/controller/api-test/files-storage-list-files.api.spec.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/files-storage/controller/api-test/files-storage-preview.api.spec.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/files-storage/service/preview.service.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/files-storage/service/preview.service.ts
Outdated
Show resolved
Hide resolved
apps/server/src/shared/infra/preview-generator/preview-generator-consumer.module.ts
Outdated
Show resolved
Hide resolved
apps/server/src/shared/infra/preview-generator/preview-generator-producer.module.ts
Outdated
Show resolved
Hide resolved
apps/server/src/shared/infra/preview-generator/preview-generator.consumer.ts
Outdated
Show resolved
Hide resolved
apps/server/src/shared/infra/preview-generator/preview-generator.service.ts
Outdated
Show resolved
Hide resolved
private readonly logger: LegacyLogger, | ||
protected readonly configService: ConfigService<any, true> | ||
) { | ||
super(amqpConnection, FilesPreviewExchange, configService.get('INCOMING_REQUEST_TIMEOUT')); |
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.
Ist configService.get('INCOMING_REQUEST_TIMEOUT') inzwischen Typ sicher? Kannst du das vorher auf eine const schreiben?
apps/server/src/shared/infra/preview-generator/preview.producer.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,7 @@ | |||
import { Configuration } from '@hpi-schul-cloud/commons/lib'; | |||
|
|||
export const FilesPreviewExchange = Configuration.get('FILES_STORAGE__EXCHANGE') as string; |
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.
Können wir die direkte Verwendung von Configuration hier vermeiden?
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.
Leider wollte Phillip, das wir exchanges konfigurierbar machen. Deswegen ist das so.
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.
Todo: Follow up Ticket für Umstellung auf nest config.
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.
{ | ||
name: FilesPreviewExchange, | ||
type: 'direct', | ||
}, | ||
], | ||
uri: Configuration.get('RABBITMQ_URI') as string, |
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.
Hier haben wir auch eine versteckte Zuweisung der Envirement.
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.
Todo: Follow up Ticket für Umstellung auf nest config.
…les' into BC-5170-no-preview-for-larger-files
ansible/roles/schulcloud-server-core/templates/preview-generator-scaled-object.yml.j2
Outdated
Show resolved
Hide resolved
idleReplicaCount: 1 | ||
minReplicaCount: 1 | ||
maxReplicaCount: 5 |
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.
Make this tree configurable
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.
it so correct ?
idleReplicaCount: 1 | |
minReplicaCount: 1 | |
maxReplicaCount: 5 | |
idleReplicaCount: {{ AMQP_FILE_PREVIEW_IDLE_REPLICA_COUNT|default("1", true) }} | |
minReplicaCount: {{ AMQP_FILE_PREVIEW_MIN_REPLICA_COUNT|default("1", true) }} | |
maxReplicaCount: {{ AMQP_FILE_PREVIEW_MAX_REPLICA_COUNT|default("5", true) }} |
ansible/roles/schulcloud-server-core/templates/preview-generator-deployment.yml.j2
Outdated
Show resolved
Hide resolved
ansible/roles/schulcloud-server-core/templates/preview-generator-scaled-object.yml.j2
Outdated
Show resolved
Hide resolved
Co-authored-by: mamutmk5 <[email protected]>
Co-authored-by: mamutmk5 <[email protected]>
Co-authored-by: mamutmk5 <[email protected]>
Co-authored-by: mamutmk5 <[email protected]>
…or-scaled-object.yml.j2 Co-authored-by: mamutmk5 <[email protected]>
ansible/roles/schulcloud-server-core/templates/preview-generator-deployment.yml.j2
Outdated
Show resolved
Hide resolved
…or-deployment.yml.j2 Co-authored-by: mamutmk5 <[email protected]>
@@ -38,3 +39,21 @@ export function createFileRecord( | |||
|
|||
return entity; | |||
} | |||
|
|||
export function getFormat(mimeType: string): string { | |||
const format = mimeType.split('/')[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.
validation fehlt ...was ist wenn [0] bzw. [1] undefined ist Das muss behandelt werden.
return fileRecord.name; | ||
} | ||
|
||
const fileNameWithoutExtension = fileRecord.name.split('.')[0]; |
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.
Das gleiche validation von [0] !== undefined bzw. die Behandlung dessen.
Ich würde das gerne auch nach fileRecord verlagern. FileRecord.getFileNameWithoutExtension()
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.
Das kann nicht geben
@@ -293,4 +293,10 @@ export class FileRecord extends BaseEntityWithTimestamps { | |||
|
|||
return PreviewStatus.PREVIEW_NOT_POSSIBLE_SCAN_STATUS_ERROR; | |||
} | |||
|
|||
public get fileNameWithoutExtension(): string { | |||
const fileNameWithoutExtension = this.name.split('.')[0]; |
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.
Das kann auch ein undefined zurück liefern, wenn nach dem Split in [0] nichts vorhanden ist.
Wenn es schon nicht behandelt wird, dann müsste zumindest der return Wert string | undefined sein.
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.
Nein? Wir haben immer ein string im name auch wenn das leer ist wird zu ""
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.
im spec ist auch ein test dazu
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.
Stimmt das liefert immer "" zurück.
Nur ".bild.123.jpg" als Test hinfügen und sollte dann ".bild.123" zurück liefern.
Kudos, SonarCloud Quality Gate passed! |
Description
Links to Tickets or other pull requests
Changes
Datasecurity
Deployment
New Repos, NPM pakages or vendor scripts
Approval for review
generate-client:server
was executed in vue frontend and changes were tested and put in a PR with the same branch name.