-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
[bug] moon ci
results in different actions plan on GHA and local
#1791
Comments
moon ci
results in different actions plan on GHA and local
@artsiommiksiuk If you pass |
Okay, I figured, that this is because it affected by GITHUB_SHA set in GHA CI. And from the documentation, if env set moon always adds this task into affected list. This is one of the tasks is defined. stack: "infrastructure"
type: "library"
env:
MT_ECR_REGISTRY: registry_address
MT_ECR_REPOSITORY: repo_name
MT_LOCAL_IMAGE_NAME: local_image_name
tasks:
...
docker-push-ci:
type: run
script: >
docker tag $MT_LOCAL_IMAGE_NAME:latest $MT_ECR_REGISTRY/$MT_ECR_REPOSITORY:latest &&
docker tag $MT_LOCAL_IMAGE_NAME:latest $MT_ECR_REGISTRY/$MT_ECR_REPOSITORY:$(git rev-parse --short $GITHUB_SHA) &&
docker push $MT_ECR_REGISTRY/$MT_ECR_REPOSITORY --all-tags
deps:
- docker-build-ci
options:
cache: false So, how can I achieve rebuild only affected packages in this case? |
Youll have to set |
Okay, that's unpredictable, but yeah, it should work. |
But I still think that this is an incorrect behavior. I'd assume that running CI, first filters by touched, then from the graph of touched cached actions should be eliminated. |
Or, I need a way to specify filtering priority flag. Like if --affected-first or --touched-first is set, then it suppose to construct actions graph based on touched files first. So, with or without caching, because implicit inputs still are just inputs, and inputs are part of a caching mechanism, If user wants to execute full graph, he should just use moon instead. |
Environment variables work just the same as touched files, so there's not much difference here. They are both considered inputs and feed into the affected tracker. This just happens to be an unfortunate scenario where an env var that constantly changes is used as an input. We probably need a blacklist of env vars to ignore, but in the meantime, turning |
I've added this and it's working. But I really still have a feeling that this shouldn't work like this anyway. I understand why ENV's might be implemented the same way as files, but this becomes misleading in the boundaries of git. Git operates with files, and assumption is that touched files supposed to be the ones that git tracks. Git doesn't track envs, therefore, envs shouldn't behave the same way when doing affected checks in this matter. I'd say, better would be if moon would be more specific. Affected for the VCS must be based on what VCS is tracking. Most VCS tracking FS entities, therefore only FS must be considered. If there will be VCS for FS, ENV and Remote resources, then it would make sense to track them the same way calculating diff. Otherwise, the rest shouldn't make a difference. I'm not sure also how this would behave with conjunction to cache? If we have something not being affected by the VCS diff, but cache, especially remote is invalid, shouldn't it be rerun then as well? I hope I wasn't too vague giving this example. |
Affected uses inputs to determine whether something is affected or not, and inputs are more than just files. This unfortunately will not change. |
Making a change in v1.32 that doesn't infer from CI/CD vars. #1811 |
v1.32 out. |
Describe the bug
On CI, with GHA, I'm using this setup:
Which results moon assembling this info:
All qrmap:* tasks never should've been picked up (nothing was changed from it's dependencies).
Meanwhile on local machine I can't reproduce it even if I specifically setting up MOON_BASE and MOON_HEAD to simulate what CI suppose to see.
It does not picks qrmap as something needing change. Which is correct.
Steps to reproduce
I really don't know how to make good reproducible example, and I'm not excluding that I don't understand something.
Expected behavior
CI moon ci run behaves the same as local.
Or, if it is some configuration error from my side, I want to know how to make
moon ci :some-command
still honor only affected targets and run only specific command, like run :some-command only for targets been affected by current commit.Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: