Skip to content

Commit

Permalink
fix(#2192): Optimize and fix vulnerabilities in frontend and metadata…
Browse files Browse the repository at this point in the history
… services
  • Loading branch information
MSzalowski committed Dec 2, 2024
1 parent 5d433b7 commit 7b641e0
Show file tree
Hide file tree
Showing 44 changed files with 4,727 additions and 33,100 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/code_check_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPMRC_TOKEN }}

- name: 🧪 Test
env:
NODE_OPTIONS: "--max_old_space_size=8192"
run: |
npm run test
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/frontend_sonar_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
- name: 🧪 Test
working-directory: govtool/frontend
env:
NODE_OPTIONS: "--max_old_space_size=6144"
NODE_AUTH_TOKEN: ${{ secrets.NPMRC_TOKEN }}
run: |
npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: "govtool/frontend/.nvmrc"
- name: Install dependencies
run: |
npm config set @intersect.mbo:registry "https://registry.npmjs.org/" --location=global
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build Storybook
run: NODE_OPTIONS="--max-old-space-size=8046" npm run build:storybook --quiet
run: npm run build:storybook --quiet
- name: Serve Storybook and run tests
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ changes.

- Fix fetching voting power of newly registerd DRep [Issue 2407](https://github.com/IntersectMBO/govtool/issues/2407)
- Fix inconsistent voting status [Issue 1713](https://github.com/IntersectMBO/govtool/issues/1713)
- Fix vulnerabilities in dependencies [Issue 2192](https://github.com/IntersectMBO/govtool/issues/2192)
- Optimize resources usage in frontend service build [Issue 2192](https://github.com/IntersectMBO/govtool/issues/2192)

### Changed

Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ RUN \
: "${VITE_USERSNAP_SPACE_API_KEY:?Build argument VITE_USERSNAP_SPACE_API_KEY is not set}" && \
: "${VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED:?Build argument VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED is not set}"

ENV NODE_OPTIONS=--max_old_space_size=8192

WORKDIR /src

# Set npm configuration settings using environment variables
RUN npm config set @intersect.mbo:registry "https://registry.npmjs.org/" --location=global
RUN npm config set //registry.npmjs.org/:_authToken ${NPMRC_TOKEN} --location=global

COPY package.json package-lock.json ./
COPY patches ./patches

RUN npm install
COPY . .
RUN npm run build
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ ARG VITE_USERSNAP_SPACE_API_KEY
ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
ARG VITE_PDF_API_URL

ENV NODE_OPTIONS=--max_old_space_size=8192

WORKDIR /src

# Set npm configuration settings using environment variables
RUN npm config set @intersect.mbo:registry "https://registry.npmjs.org/" --location=global
RUN npm config set //registry.npmjs.org/:_authToken ${NPMRC_TOKEN} --location=global

COPY package.json package-lock.json ./
COPY patches ./patches

RUN npm install
COPY . .
RUN npm run build
Expand Down
325 changes: 205 additions & 120 deletions govtool/frontend/junit-report.xml

Large diffs are not rendered by default.

Loading

0 comments on commit 7b641e0

Please sign in to comment.