Skip to content
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

Unclear inferred version number #129

Closed
bergtwvd opened this issue Jan 1, 2023 · 6 comments
Closed

Unclear inferred version number #129

bergtwvd opened this issue Jan 1, 2023 · 6 comments
Assignees

Comments

@bergtwvd
Copy link

bergtwvd commented Jan 1, 2023

Before we use nyx in anger, we have set up a small test environment.
We use the extended preset and are confused in the inferred version number for both main and development branches. Could you explain how we get to the version numbers?

We also see an odd message in the (attached) debug log for the infer on the development branch:
DEBU[0000] current repository status 'DIRTY' not matched by release type 'integration' matchWorkspaceStatus filter 'CLEAN'. Skipping release type 'integration'

This hints to uncommitted files in the workspace, but there are none (i.e. clean status).
Could you explain?

Log file: infer-debug.txt

Steps to reproduce:

From GitLab webUI:
1. create empty repo, with README file
2. create file .nyx.yml with JSON content: { "preset":"extended" }
3. create "development" branch

From workspace:
1. clone repo
2. switch to development branch

From other shell:
3. start container:  docker run --rm -it --entrypoint=sh -v $PWD/:/project mooltiverse/nyx
4. nyx --info
   INFO[0000] Version: '0.1.0'

From workspace, development branch:
5. commit and push file "test.txt" (content "hello") with commit message "feat: minor fix"

From container:
6. nyx --info
   INFO[0000] Version: '0.2.0-internal.1+timestamp.19700120083646'
   
From workspace:
7. switch to main branch
8. commit and push file "test2.txt" (content "hello2") with commit message "feat: minor fix2"

From container:
9. nyx --info
   INFO[0000] Version: '0.2.0-internal.1+timestamp.19700120083648'

From workspace:
10. switch to development branch

From container:
11. nyx --info
   INFO[0000] Version: '0.2.0-internal.1+timestamp.19700120083648'
@flelli flelli self-assigned this Jan 2, 2023
@flelli
Copy link
Collaborator

flelli commented Jan 2, 2023

Hi @bergtwvd ,

I guess you already hit the point as the issue is only about the workspace status, which is DIRTY. If you run git status in both branches you should see the pending (uncommitted) changes.
As an alternative you can override the release type configuration and remove the matchWorkspaceStatus filter do it doesn't prevent a certain release type to be matched if there are uncommitted changes.

@flelli flelli closed this as completed Jan 2, 2023
@bergtwvd
Copy link
Author

bergtwvd commented Jan 4, 2023

Hi, I am still puzzled how nyx gets the the name internal in the version.

I do a fresh clone of the repository and a git status:

image

In this example there is a main and development branch, but not tags have been set yet. The following files are committed:

image

Where .nyx.yml contains:

image

Next I start the container with nyx:

image

And I run the command nyx --info:

image

Looking in the log with debug I see that nyx marks the repo status as dirty, skipping mainline as branch, and it eventually ends up using internal as name:

image

I this how it is supposed to work?

@flelli
Copy link
Collaborator

flelli commented Jan 4, 2023

Hi, that's the expected behavior unless Nyx fails to detect the repo status (CLEAN or DIRTY). Can you please run git status right before and after running Nyx?

@flelli
Copy link
Collaborator

flelli commented Jan 5, 2023

After testing with different scenarios I've hit some cases where the CLEAN/DIRTY is wrong. I'm reopening this issue

@flelli
Copy link
Collaborator

flelli commented Jan 5, 2023

After a quick investigation it turns out there's a bug. I opened #130 for this

@flelli flelli closed this as completed Jan 5, 2023
flelli added a commit that referenced this issue Jan 24, 2023
* chode: add debug logs

* chore: clean some illegal characters

* chore: clean unnecessary import statements

* test: bug #130 reproduced (Go tests are supposed to fail) #129 #130

* fix: wrong inferred Git workspace status in Go #130 #129

* test: bug #130 reproduced (Go tests are supposed to fail) #129 #130

* fix: wrong inferred Git workspace status in Go #130 #129

* test: bug #130 reproduced (Go tests are supposed to fail) #129 #130

* test: bug #130 reproduced (Go tests are supposed to fail) #129 #130

* test: bug #130 reproduced (Go tests are supposed to fail) #129 #130

* test: bug #130 reproduced (Go tests are supposed to fail) #129 #130

* fix: wrong inferred Git workspace status in Go #130 #129

* build: enable matrix build for Go integration tests (some Go integration tests may fail)

* build: enable matrix build for Go unit tests (some Go integration tests may fail)

* test: testing again after introducing the test matrix for Go unit and integration tests
@flelli
Copy link
Collaborator

flelli commented Jan 24, 2023

Fix is generally available in release 1.3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants