-
Notifications
You must be signed in to change notification settings - Fork 8
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
.gitignore
is not respected during nyx mark
#219
Comments
Hi @rrzal , I tried to reproduce the bug locally without success. Nyx behaves correctly, complying with Are you able to reproduce locally? This would help removing the GitLab context from the issue. Linking the the #216 you mentioned. |
I was able to reproduce it in my local environment, My local environment is actually also my CI environment (I'm using a shell runner for my CI). I manually merged a branch into development, everything was fine. Then I ran nyx mark, and suddenly nyx-state and summary got added to the release commit. |
Thanks @rrzal , meanwhile, is there a chance the state file was added to the Git repo in the past and then removed? |
I don't remember how it was added in the first place (whether I forgot to add |
I'm afraid this is where we hit the issue. I double and triple-checked the code and there's nothing that may push the library used by Nyx to behave like when the I'm not even sure it's an issue caused by the library used by Nyx. One last that might be useful would be running it again on a new repository where the state file is in the |
Sorry, I need to take back my previous statement. I tested again and verified that if I run I then pushed my locally merged So it seems like this issue is indeed related to GitLab runner. Since now the Docker image is available again, I want to test running the release job in Docker. However, the Docker image on Docker Hub seems to be broken at the moment. I created a empty first stage just to test the image: pipeline-test-job:
stage: pipeline-test
tags:
- docker
image: mooltiverse/nyx:2.4.1-hotfix221.2
script:
- ls and it's giving me this error: Preparing the "docker" executor 00:02
Using Docker executor with image mooltiverse/nyx ...
Pulling docker image mooltiverse/nyx ...
Using docker image sha256:fb6600c1ef30a37f6deb749bb47f90a5a05e41f8d4a769016c8c4a91347a881e for mooltiverse/nyx with digest mooltiverse/nyx@sha256:31a9afb643641acaa85b98a0f0e1553841f8e8a7dc63d643c2efdfca051b664a ...
Preparing environment 00:00
Running on runner-6bqdcmks-project-948-concurrent-0 via ayar-nuc-63...
Getting source from Git repository 00:02
Fetching changes...
Initialized empty Git repository in /builds/apps_engineering/ci-test/.git/
Created fresh repository.
Checking out 4cbf981d as detached HEAD (ref is task/none/test_mark_with_docker)...
Skipping Git submodules setup
Executing "step_script" stage of the job script 00:00
Using docker image sha256:fb6600c1ef30a37f6deb749bb47f90a5a05e41f8d4a769016c8c4a91347a881e for mooltiverse/nyx with digest mooltiverse/nyx@sha256:31a9afb643641acaa85b98a0f0e1553841f8e8a7dc63d643c2efdfca051b664a ...
time="2023-05-23T23:07:35Z" level=error msg="an empty path has been defined for the local custom configuration file and it will be ignored"
illegal command 'SH'
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1 I also tested other images like |
Hi @rrzal It looks like the container is started with wrong command line attributes, for example |
I'm not sure where I can pass the debug option, but I fixed this issue by overriding the Docker image entrypoint in my pipeline config: pipeline-test-job-2:
stage: pipeline-test
tags:
- docker
image:
name: mooltiverse/nyx:2.4.1-hotfix221.2
entrypoint: [""]
script:
- git checkout -b $CI_COMMIT_BRANCH
- nyx Now it works correctly. |
@flelli Preparing the "docker" executor 00:02
Using Docker executor with image mooltiverse/nyx:2.4.1-hotfix221.2 ...
Pulling docker image mooltiverse/nyx:2.4.1-hotfix221.2 ...
Using docker image sha256:d8d42c12315d8e0597253311475e75ac19fb6aee5b2cf162c12ad57812f55fe2 for mooltiverse/nyx:2.4.1-hotfix221.2 with digest mooltiverse/nyx@sha256:10e9605ad2e2d1a1ac42b827b1695dbc08d3c417a763fe7afcd260f735cf2dd1 ...
Preparing environment 00:01
Running on runner-ipqyvdhy-project-952-concurrent-0 via 63...
Getting source from Git repository 00:01
Fetching changes...
Initialized empty Git repository in /builds/apps_engineering/another-ci-test/.git/
Created fresh repository.
Checking out fbab72c4 as detached HEAD (ref is development)...
Skipping Git submodules setup
Downloading artifacts 00:01
Downloading artifacts for build-job1 (50312)...
Downloading artifacts from coordinator... ok
Executing "step_script" stage of the job script 00:02
Using docker image sha256:d8d42c12315d8e0597253311475e75ac19fb6aee5b2cf162c12ad57812f55fe2 for mooltiverse/nyx:2.4.1-hotfix221.2 with digest mooltiverse/nyx@sha256:10e9605ad2e2d1a1ac42b827b1695dbc08d3c417a763fe7afcd260f735cf2dd1 ...
$ git checkout -b $CI_COMMIT_BRANCH
Switched to a new branch 'development'
$ nyx clean
$ ls -a
.
..
.git
.gitignore
.gitlab-ci.yml
.nyx.json
README.md
ci_scripts
version.h
$ git status
On branch development
Untracked files:
(use "git add <file>..." to include in what will be committed)
version.h
nothing added to commit but untracked files present (use "git add" to track)
$ nyx
branch = development
bump = minor
core version = true
latest version = true
new release = true
new version = true
scheme = SEMVER
timestamp = 1684952659724
current version = v0.2.0
previous version = 0.1.0
prime version = 0.1.0
$ ls -a
.
..
.git
.gitignore
.gitlab-ci.yml
.nyx-state.json
.nyx.json
README.md
ci_scripts
version.h
$ git status
On branch development
Untracked files:
(use "git add <file>..." to include in what will be committed)
version.h
nothing added to commit but untracked files present (use "git add" to track)
$ git config user.name "Linux CI Station"
$ git config user.email "you@example.com"
$ nyx mark
branch = development
bump = minor
core version = true
latest version = true
new release = true
new version = true
scheme = SEMVER
timestamp = 1684952659750
current version = v0.2.0
previous version = 0.1.0
prime version = 0.1.0
$ ls -a
.
..
.git
.gitignore
.gitlab-ci.yml
.nyx-state.json
.nyx.json
README.md
ci_scripts
version.h
$ git status
On branch development
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .nyx-state.json
no changes added to commit (use "git add" and/or "git commit -a")
Cleaning up project directory and file based variables 00:01
Job succeeded |
This is getting weird... I'm wondering but I can't figure out what could make the GitLab environment change the behavior. |
I've tried everything I can think of:
I think at this point I'll have to resort to using script to manually delete any artifacts that should be in |
Hi @rrzal , you can't pass null but you can pass an empty string. Have you tried that? Another try could be generating the state file in a subdirectory and ignore the directory. |
@rrzal , this issue seems related to go-git/go-git#500 in go-git What I can try is to rebuild with the latest go-git and hope they fixed it |
Hi @flelli , thanks for the reply. I cannot pass an empty string because nyx would try to write to Also putting it under a directory wouldn't work, because the git bug causes nyx to add everything, including any directories to the commit (for example, my However, your suggestion does give me an idea, which is to put it outside the repo folder. I tried |
Thank you! I'll keep an eye on the releases and test them. |
So this is a bug. I opened #230 |
@rrzal , meanwhile, taking some hints from the go-git open issues, it could be worthwhile inspecting the git settings as it's likely that GitLab sets some specific settings that are different from your local environment and those may be the culprit. |
Hi @rrzal , 2.4.4-hotfix219.1 is ready. Can you give it a try? |
Unfortunately the fix doesn't seem to work. Everything in the workspace still get added to the commit. Have you looked at go-git/go-git#597 ? could this be a work around? I also printed my git config in the pipeline: $ uchardet .gitignore
ASCII
$ git config --list
init.defaultbranch=none
fetch.recursesubmodules=false
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=....git)
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
lfs.repositoryformatversion=0
user.name=Linux CI Station
user.email=you@example.com |
@rrzal , I've embedded that workaround in 2.4.4-hotfix219.3. Can you give it a try? |
@flelli , I can't tell you how happy I am. It indeed works! |
@rrzal , glad to hear that. I'm mergin to main and the fix will be available in the upcoming release |
I mentioned this problem in another issue. I've added some logging in my pipeline to debug this issue a little bit further.
My
.gitignore
:my
.gitlab-ci.yml
:This is the log for my
release-job
, you can seenyx-state
is indeed been added and committed afternyx mark
despite the presence of.gitignore
:Here's the trace log for
nyx mark
if you are interested, though I didn't find anything useful from it.The text was updated successfully, but these errors were encountered: