Skip to content

feat: enhance product/banner image validation (#14) - #55

Open
JustSamuel wants to merge 1 commit into
developfrom
feature/EnhanceImageValidation
Open

feat: enhance product/banner image validation (#14)#55
JustSamuel wants to merge 1 commit into
developfrom
feature/EnhanceImageValidation

Conversation

@JustSamuel

Copy link
Copy Markdown
Collaborator

Ported from GEWIS/sudosos-backend#735.

This branch was already CONFLICTING against old backend develop before the monorepo move, unrelated to the port itself. The only real conflict was in validation-errors.ts, where develop had independently added TOS_NOT_ACCEPTED next to where this PR adds INVALID_IMAGE_FILE -- kept both exports.

pnpm-lock.yaml needed a regeneration (now consolidated at the repo root) to pick up the new sharp dependency this PR adds. Ran the affected test files directly (product-controller, banner-controller, file-service) to confirm sharp's image validation actually works at runtime after the lockfile regen, not just that it typechecks -- all pass.

backend:build and backend:lint both pass.

@github-actions

Copy link
Copy Markdown

SudoSOS Coverage Report

Commit: 0e77b4a
Base: develop@587e808

Type Base This PR
Total Statements Coverage  93.09%  93.11% (+0.02%)
Total Branches Coverage  87.92%  87.91% (-0.01%)
Total Functions Coverage  93.83%  93.85% (+0.02%)
Total Lines Coverage  93.09%  93.11% (+0.02%)
Details (changed files)
FileStatementsBranchesFunctionsLines

The full per-file breakdown is omitted to stay under GitHub's 65,536-character comment limit. Download the coverage artifact from this workflow run for the complete report, or view it on Coveralls.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 31797206194

Coverage increased (+0.01%) to 92.216%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: 69 of 69 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 24391
Covered Lines: 22711
Line Coverage: 93.11%
Relevant Branches: 5080
Covered Branches: 4466
Branch Coverage: 87.91%
Branches in Coverage %: Yes
Coverage Strength: 821.89 hits per line

💛 - Coveralls

@XtarXyan
XtarXyan force-pushed the feature/EnhanceImageValidation branch from 0e77b4a to 36e3d3b Compare September 5, 2026 20:23
@XtarXyan
XtarXyan requested a review from RubenLWF as a code owner September 5, 2026 20:23
@XtarXyan
XtarXyan force-pushed the feature/EnhanceImageValidation branch from 6c6b46d to 0dbf840 Compare September 5, 2026 21:22
Updated commit:
- moved validation check after product existence check
- updated validation values
- moved image-validation.ts to backend/src/helpers
- disabled eslint no-shadow in the file-service.ts unit test UploadFile.mv test stub per PR review

Adjusted image/banner assets and import accordingly
@XtarXyan
XtarXyan force-pushed the feature/EnhanceImageValidation branch from 0dbf840 to ed81dca Compare September 5, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants