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

Sparse checkout seems to be triggered when not intended #1378

Closed
bzbarsky-apple opened this issue Jun 9, 2023 · 13 comments
Closed

Sparse checkout seems to be triggered when not intended #1378

bzbarsky-apple opened this issue Jun 9, 2023 · 13 comments

Comments

@bzbarsky-apple
Copy link

We have some GitHub CI that uses the checkout action like so:

            - uses: Wandalen/wretry.action@v1.0.36
              name: Checkout
              with:
                  action: actions/checkout@v3
                  with: |
                      submodules: true
                      token: ${{ github.token }}
                  attempt_limit: 3
                  attempt_delay: 2000

As of this morning all checkouts stopped working with this error:

Error: fatal: --filter can only be used when extensions.partialClone is set

You can compare a failing run at https://github.com/project-chip/connectedhomeip/actions/runs/5223466703/jobs/9430364364 with a passing run from a few hours earlier at https://github.com/project-chip/connectedhomeip/actions/runs/5222975743/jobs/9429182655.

The failing run is running this git command:

/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --filter=blob:none --depth=1 origin +136a312c1cd14c44c6187211b9e56365abc168eb:refs/remotes/pull/27177/merge

while the passing one ran this one:

 /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +afef8aa2c4add14255a80d46cb44c8380326c934:refs/remotes/pull/27157/merge

note the extra --filter=blob:none that is present in the failing command. This is presumably a change from #1369. I do see that that bit is conditoned on settings.sparseCheckout in that PR, but we are not setting sparseCheckout to anything anywhere in our repository...

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Jun 9, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378
andy31415 pushed a commit to project-chip/connectedhomeip that referenced this issue Jun 9, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378
@dfdez
Copy link
Contributor

dfdez commented Jun 9, 2023

I will take a look to see what is the issue here!

@dfdez
Copy link
Contributor

dfdez commented Jun 10, 2023

Hey @bzbarsky-apple after taking a look to this issue and making some test I figure out that it likely to be an error in relation with Wandalen/wretry.action@v1.0.36

I made some debug on Wandalen/wretry.action@v1.0.36 and when I run the action as you described the sparse-checkout option is set to "null" for some reason

Screenshot 2023-06-10 at 02 17 20

I'm trying to figure out why this is happening but from the moment that is everything that I can do for you!

I will inform you with any news if any.

@dfdez
Copy link
Contributor

dfdez commented Jun 10, 2023

The problem might be that if Wandalen/wretry.action@v1.0.36 setup default env, when running the getInput function of actions/toolkit the default INPUT_SPARSE_CHECKOUT=null might be transformed to actually "null"

Screenshot 2023-06-10 at 02 25 08

I'm just speculating here because I don't know how Wandalen/wretry.action@v1.0.36 works, but that's where the problem can come from

Also here is an Wandalen/wretry.action issue that might be related with this topic

Regarding this issue I have run testing with edge cases like setting up sparse-checkout: "" or sparse-checkout: null and is working as expected therefore from the moment this doesn't seem to be an issue of actions/checkout

@bzbarsky-apple
Copy link
Author

Where would that INPUT_SPARSE_CHECKOUT=null be coming from? I don't see mentions of INPUT_SPARSE_CHECKOUT anywhere in the checkout repository, in https://github.com/Wandalen/wretry.action or in the connectedhomeip repository... Also no SPARSE_CHECKOUT in the latter two repos and no INPUT_ anywhere near github actions in connectedhomeip or anywhere in wretry.action.

If you are able to reproduce this in a setting where you can modify the checkout code that's running, I would be very interested to know whether INPUT_SPARSE_CHECKOUT is in fact set in getInput. I would also be very interested in knowing how to run the checkout action that way, of course.

@dfdez
Copy link
Contributor

dfdez commented Jun 10, 2023

Hey @bzbarsky-apple I have been taking a deeper look to this and now I can confirm that the issue is from wretry.action.

If you go to the js_action branch you can see on the Common.js a function called envOptionsFrom this function seems to process the options from the actions, if you see the code there is a conditional that is passing.

if( !( key in options ) && inputs[ key ].default !== undefined )

When reading the yaml the default option for sparse-checkout is null therefore when processing then env the env process.env[ key ] = null will end up being "null"

That is why Wandalen/wretry.action is setting sparse-checkout to "null" by default...

@bzbarsky-apple
Copy link
Author

Interesting. So this is from action.yml in the checkout action, I see.

@dfdez
Copy link
Contributor

dfdez commented Jun 13, 2023

Yes, but there is nothing we can do here, the issue is from wretry.action.

I have added an issue to see if they can fix it! Wandalen/wretry.action#85

@Shiho240
Copy link

I actually have the opposite problem but same error with github actions when I use ACT to run actions locally for testing. I get the Error: fatal: --filter can only be used when extensions.partialClone is set when i attempt to do a sparse checkout using the sparse-checkout option.

@dfdez
Copy link
Contributor

dfdez commented Jun 16, 2023

@MasterShihoChief this is an issue that will happen when using git versions between 2.25 and 2.28being 2.28 the one that should work without any problem, you can see the commit of git here

I have opened an issue to see how we can solve this problem #1386 👍🏽

@Shiho240
Copy link

I was actually using git 2.37.1

@dfdez
Copy link
Contributor

dfdez commented Jun 16, 2023

I have run some test using the git version 2.37.1 and I wasn't able to reproduce the error 🤔

Is it possible to have the logs ? Or at least the configuration that you are using on actions/checkout@v3 to be able to debug the issue?

Also I've been taking a look to the git repo and that error make sense to have it if you have a git version < 2.28 as you can see in the fetch.c

I wasn't able to find any other place on the code that referes that error after 2.28... Are you sure you are using git 2.37.1?

ArekBalysNordic pushed a commit to ArekBalysNordic/sdk-connectedhomeip that referenced this issue Jun 22, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
ArekBalysNordic pushed a commit to ArekBalysNordic/sdk-connectedhomeip that referenced this issue Jun 22, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
ArekBalysNordic pushed a commit to nrfconnect/sdk-connectedhomeip that referenced this issue Jun 22, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
ArekBalysNordic pushed a commit to ArekBalysNordic/sdk-connectedhomeip that referenced this issue Jun 22, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
ArekBalysNordic pushed a commit to ArekBalysNordic/sdk-connectedhomeip that referenced this issue Jun 22, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
@dfdez
Copy link
Contributor

dfdez commented Jun 22, 2023

@bzbarsky-apple this can be closed! Wandalen/wretry.action#85 (comment)

@bzbarsky-apple
Copy link
Author

Perfect, thanks!

ArekBalysNordic pushed a commit to ArekBalysNordic/sdk-connectedhomeip that referenced this issue Jun 28, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
ArekBalysNordic pushed a commit to nrfconnect/sdk-connectedhomeip that referenced this issue Jun 30, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
ArekBalysNordic pushed a commit to ArekBalysNordic/sdk-connectedhomeip that referenced this issue Jul 11, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
Damian-Nordic pushed a commit to Damian-Nordic/sdk-connectedhomeip that referenced this issue Jul 19, 2023
3.5.3 sparse checkout support seems to break in our CI.  See
actions/checkout#1378

Cherry-Picked from: 7f6723f
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

3 participants