Skip to content

Conversation

@hervyt
Copy link
Member

@hervyt hervyt commented Aug 27, 2025

Context:

Describe briefly the context of you PR. Add any relevant screenshots or screen recording for the product team.

How to test:

Describe how to reproduce and test what you've done. Add screeshots of you local tests.

What tests has been made:

  • Integration tests
  • E2E tests
  • Local tests

Additional information:

Related #885

@hervyt hervyt force-pushed the tech/nx-improvments branch 4 times, most recently from 9090fef to 9dd8d83 Compare August 27, 2025 12:17
@Kroustille Kroustille force-pushed the tech/nx-improvments branch 6 times, most recently from 224ac6f to fb5579d Compare August 28, 2025 07:20
@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 2.30%. Comparing base (49a5017) to head (38d223a).
⚠️ Report is 2 commits behind head on development.

❗ There is a different number of reports uploaded between BASE (49a5017) and HEAD (38d223a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (49a5017) HEAD (38d223a)
2 1
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #878       +/-   ##
===============================================
- Coverage        20.41%   2.30%   -18.11%     
===============================================
  Files              487     315      -172     
  Lines            27958   17321    -10637     
  Branches          1026     348      -678     
===============================================
- Hits              5708     400     -5308     
+ Misses           22023   16707     -5316     
+ Partials           227     214       -13     

see 172 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 422ee83...38d223a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
19 19 0 0 0 0 2m 18s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
19 0 0 26.4s

Suites

19 passed, 0 failed, and 0 other

Suite Passed Failed Other Duration
✅ app/apps/portal-e2e-tests/tests/tests_files/api/user.spec.ts
        ✅ should prevent user to update another one when he does not have MANAGE_ACCESS
        ✅ should allow user to update another one when he has ADMINISTRATE_ORGANIZATION
        ✅ should allow user to update another one when he has MANAGE_ACCESS
✅ 3 ❌ 0 ⏭️ 0 4.8s
✅ app/apps/portal-e2e-tests/tests/tests_files/capabilities.spec.ts
        ✅ Should add subscription with capabilities
✅ 1 ❌ 0 ⏭️ 0 26.4s
✅ app/apps/portal-e2e-tests/tests/tests_files/csv-feeds.spec.ts
        ✅ Should add CSV Feed
        ✅ Should delete CSV Feed from the list
        ✅ Should delete CSV Feed from the detailed page
✅ 3 ❌ 0 ⏭️ 0 25.0s
✅ app/apps/portal-e2e-tests/tests/tests_files/custom-dashboards.spec.ts
        ✅ Should add custom dashboard
        ✅ Should see the custom dashboard on public page
        ✅ Should edit a custom dashboard
✅ 3 ❌ 0 ⏭️ 0 28.4s
✅ app/apps/portal-e2e-tests/tests/tests_files/document.spec.ts
        ✅ should perform complete CRUD operations on documents
✅ 1 ❌ 0 ⏭️ 0 5.6s
✅ app/apps/portal-e2e-tests/tests/tests_files/organizations.spec.ts
        ✅ should perform complete CRUD operations on organizations
✅ 1 ❌ 0 ⏭️ 0 6.5s
✅ app/apps/portal-e2e-tests/tests/tests_files/profile.spec.ts
        ✅ should update user profile information
✅ 1 ❌ 0 ⏭️ 0 4.7s
✅ app/apps/portal-e2e-tests/tests/tests_files/public/redirections.spec.ts
        ✅ should redirect user between public pages and login page
✅ 1 ❌ 0 ⏭️ 0 3.2s
✅ app/apps/portal-e2e-tests/tests/tests_files/service-management.spec.ts
        ✅ should be able to admin service
✅ 1 ❌ 0 ⏭️ 0 13.0s
✅ app/apps/portal-e2e-tests/tests/tests_files/service-pictures.spec.ts
        ✅ should be able to add pictures to a service
✅ 1 ❌ 0 ⏭️ 0 3.8s
✅ app/apps/portal-e2e-tests/tests/tests_files/user.spec.ts
        ✅ Should perform complete CRUD of users as BYPASS
        ✅ Should only see authorized users
        ✅ Should not edit first and last name as MANAGE_ACCESS user
✅ 3 ❌ 0 ⏭️ 0 16.3s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

@Kroustille Kroustille changed the title DRAFT Tech/nx improvments [ci] chore: use nx to build sources before docker images Aug 28, 2025
@Kroustille Kroustille marked this pull request as draft August 28, 2025 10:09
@Kroustille Kroustille added the Filigran Team use to identify PR from the Filigran team label Aug 28, 2025
Comment on lines 28 to 76
runs-on: ubuntu-latest
outputs:
has-api-changes: ${{ steps.check-changes.outputs.api }}
has-front-changes: ${{ steps.check-changes.outputs.front }}
has-e2e-changes: ${{ steps.check-changes.outputs.e2e }}
base-sha: ${{ steps.setSHAs.outputs.base }}
head-sha: ${{ steps.setSHAs.outputs.head }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head
id: setSHAs
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'development'
- run: corepack enable && corepack prepare [email protected]
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'yarn'
- run: yarn install --immutable
- name: Check what changed
id: check-changes
run: |
AFFECTED=$(npx nx show projects --affected --base=${{ steps.setSHAs.outputs.base }} --head=${{ steps.setSHAs.outputs.head }})
echo "Affected projects:"
echo "$AFFECTED"
if echo "$AFFECTED" | grep -q "portal-api"; then
echo "api=true" >> $GITHUB_OUTPUT
else
echo "api=false" >> $GITHUB_OUTPUT
fi
if echo "$AFFECTED" | grep -q "portal-front"; then
echo "front=true" >> $GITHUB_OUTPUT
else
echo "front=false" >> $GITHUB_OUTPUT
fi
if echo "$AFFECTED" | grep -q "portal-e2e-tests"; then
echo "e2e=true" >> $GITHUB_OUTPUT
else
echo "e2e=false" >> $GITHUB_OUTPUT
fi
build-source:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 2 months ago

To fix the issue, explicitly declare a permissions block at the top/root of the workflow (i.e., right after the name: or on: block). If all jobs only need minimal access (most CI pipelines just need to read source files), set permissions to contents: read, which allows only read access to repository contents, following the principle of least privilege. If any jobs require additional permissions (for example, creating releases, updating pull requests, or opening issues), those job(s) should get appropriately scoped permissions, but only as required. For the code shown, there is no indication that any job needs write permissions, so we will add permissions: contents: read at the top, immediately after the name: Run XTM Hub CI/CD line.

No methods, definitions, or imports are necessary—all changes are confined to the workflow YAML.


Suggested changeset 1
.github/workflows/dockerbuild-ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/dockerbuild-ci.yml b/.github/workflows/dockerbuild-ci.yml
--- a/.github/workflows/dockerbuild-ci.yml
+++ b/.github/workflows/dockerbuild-ci.yml
@@ -1,4 +1,6 @@
 name: Run XTM Hub CI/CD
+permissions:
+  contents: read
 on:
   workflow_dispatch:
   push:
EOF
@@ -1,4 +1,6 @@
name: Run XTM Hub CI/CD
permissions:
contents: read
on:
workflow_dispatch:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@hervyt hervyt force-pushed the tech/nx-improvments branch 5 times, most recently from 18341f4 to 6f7d112 Compare September 3, 2025 08:19
Comment on lines 77 to 157
runs-on: ubuntu-latest
outputs:
docker-tag: ${{ steps.generate-tag.outputs.tag }}
cache-tag: ${{ steps.generate-tag.outputs.cache-tag }}
steps:
- name: Generate unique tag for this run
id: generate-tag
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
TAG="pr-${{ github.event.number }}"
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
TAG="main"
elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then
TAG="development"
else
TAG="test-${{ github.sha }}"
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
CACHE_TAG="pr-cache"
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
CACHE_TAG="main-cache"
elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then
CACHE_TAG="dev-cache"
else
CACHE_TAG="test-cache"
fi
echo "cache-tag=$CACHE_TAG" >> $GITHUB_OUTPUT
build-images-tests:
build-test-images:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
@hervyt hervyt force-pushed the tech/nx-improvments branch 6 times, most recently from ff084a2 to 26a28bd Compare September 3, 2025 13:29
@hervyt hervyt force-pushed the tech/nx-improvments branch from 2573322 to 38d223a Compare September 19, 2025 08:30
Comment on lines 320 to 337
needs: build-test-images
runs-on: ubuntu-latest
timeout-minutes: 10
if: |
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'needs feature env')
steps:
- name: Install AWX cli
run: pip install awxkit

- name: Deploy
run: |
awx --conf.host https://awx.filigran.io \
--conf.token ${{ secrets.AWX_TOKEN }} \
-f human job_templates launch 'Deploy XTM Hub feature branch for testing' \
--inventory eu-west-staging \
--extra_vars "{\"env\":\"Development\",\"xtmhub_version\":\"pr-${{ github.event.number }}\",\"xtmhub_node_env\":\"development\"}"
delete-feature-branch:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event_name == 'pull_request' && github.event.action == 'closed'
steps:
- name: Install AWX cli
run: pip install awxkit

- name: Delete
run: |

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI about 2 months ago

To address this security warning, an explicit permissions key must be added to limit the permissions of the GITHUB_TOKEN that workflows and jobs run with. The most robust approach is to declare the most restrictive permissions possible at the root of the workflow (permissions: {}), defaulting all jobs to "no permissions" with the token. Individual jobs that require more access can explicitly set a more permissive permissions block in their own configuration as needed (e.g., as already done for run-front-unit-tests).
This means adding the following YAML to the workflow after the name: field but before on::

permissions: {}

This change ensures all jobs have no permissions by default unless overridden per-job—maximally limiting privilege and satisfying the CodeQL scanner.

Suggested changeset 1
.github/workflows/dockerbuild-ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/dockerbuild-ci.yml b/.github/workflows/dockerbuild-ci.yml
--- a/.github/workflows/dockerbuild-ci.yml
+++ b/.github/workflows/dockerbuild-ci.yml
@@ -1,4 +1,5 @@
 name: Run XTM Hub CI/CD
+permissions: {}
 on:
   workflow_dispatch:
   push:
EOF
@@ -1,4 +1,5 @@
name: Run XTM Hub CI/CD
permissions: {}
on:
workflow_dispatch:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@Kroustille Kroustille marked this pull request as draft September 23, 2025 09:09
@jbanety jbanety force-pushed the development branch 2 times, most recently from 1abcd8f to c5ee434 Compare October 17, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Filigran Team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants