e-square-io / nx-github-actions

A set of Github Actions for NX workspaces
MIT License
30 stars 6 forks source link

affected matrix ignores e2e target #54

Closed robinpellegrims closed 2 years ago

robinpellegrims commented 2 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When the e2e target is requested and the only changes in a PR are in an e2e project, the @e-square/nx-affected-matrix action returns no tasks.

Expected behavior

@e-square/nx-affected-matrix should return a task to e2e test the affected e2e project so that the modified e2e tests will be executed.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

When a PR only contains changes in an e2e project, we want to make sure the e2e tests are still passing succesfully before merging.

Environment


- Nx version: 14.4.2 
ronnetzer commented 2 years ago

Hi @robinpellegrims

can you add some logs (make sure you run it in debug mode), specifically from this part ⚙️ Generating affected matrix for blablabla

robinpellegrims commented 2 years ago

Hi @robinpellegrims

can you add some logs (make sure you run it in debug mode), specifically from this part ⚙️ Generating affected matrix for blablabla

::group::⚙️ Generating affected matrix for test,lint,e2e,build
⚙️ Generating affected matrix for test,lint,e2e,build
  ##[debug]🐞 Calculating affected for "test" target
  ##[debug]🐞 Calculating affected for "lint" target
  ##[debug]🐞 Calculating affected for "e2e" target
  ##[debug]🐞 Calculating affected for "build" target
  ##[debug]🐞 matrix: {
  ##[debug]  "include": [
  ##[debug]    {
  ##[debug]      "target": "lint",
  ##[debug]      "distribution": 1,
  ##[debug]      "projects": "pellegrims-dev-e2e"
  ##[debug]    },
  ##[debug]    {
  ##[debug]      "target": "e2e",
  ##[debug]      "distribution": 1,
  ##[debug]      "projects": "pellegrims-dev-e2e"
  ##[debug]    }
  ##[debug]  ]
  ##[debug]}
  ✅ Generated affected matrix
  ::endgroup::

::set-output name=matrix::{"include":[{"target":"lint","distribution":1,"projects":"pellegrims-dev-e2e"},{"target":"e2e","distribution":1,"projects":"pellegrims-dev-e2e"}]}
##[debug]steps.calculate.outputs.matrix='{"include":[{"target":"lint","distribution":1,"projects":"pellegrims-dev-e2e"},{"target":"e2e","distribution":1,"projects":"pellegrims-dev-e2e"}]}'

::set-output name=apps::
##[debug]steps.calculate.outputs.apps=''

::set-output name=libs::
##[debug]steps.calculate.outputs.libs=''

::set-output name=hasChanges::false
##[debug]steps.calculate.outputs.hasChanges='false'
ronnetzer commented 2 years ago

@robinpellegrims The generated matrix seems valid but I do note that hasChanges is false, I guess this is the main issue here. But just to make sure, are you expecting e2e projects to be included in the apps output as well?

robinpellegrims commented 2 years ago

@robinpellegrims The generated matrix seems valid but I do note that hasChanges is false, I guess this is the main issue here. But just to make sure, are you expecting e2e projects to be included in the apps output as well?

Yes indeed, I think that would be more correct, no?

robinpellegrims commented 2 years ago

Thank you!