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

[ISSUE]: unsupported extension name extensions.worktreeconfig #1090

Closed
2 tasks done
pascalgulikers opened this issue Mar 12, 2024 · 15 comments · Fixed by #1092
Closed
2 tasks done

[ISSUE]: unsupported extension name extensions.worktreeconfig #1090

pascalgulikers opened this issue Mar 12, 2024 · 15 comments · Fixed by #1092

Comments

@pascalgulikers
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitHub Actions

What are you seeing?

Run gittools/actions/gitversion/execute@v0
  with:
    disableCache: false
    disableNormalization: false
    useConfigFile: false
    configFilePath: GitVersion.yml
    updateAssemblyInfo: false
    
Agent: 'GitHub Actions'
Command: git rev-parse --is-shallow-repository
/usr/bin/git rev-parse --is-shallow-repository
false
Command: dotnet-gitversion /home/ubuntu/_work/***/*** /output json /output buildserver
/home/ubuntu/_work/_tool/GitVersion.Tool/5.12.0/x64/dotnet-gitversion /home/ubuntu/_work/***/*** /output json /output buildserver
INFO [03/12/24 12:04:45:30] Working directory: /home/ubuntu/_work/***/***
unsupported extension name extensions.worktreeconfig
INFO [03/12/24 12:04:45:33] Done writing 
Error: Error: The process '/home/ubuntu/_work/_tool/GitVersion.Tool/5.12.0/x64/dotnet-gitversion' failed with exit code 1

What is expected?

To continue instead of halt.

/usr/bin/git version
  git version 2.34.1

Steps to Reproduce

It worked until now, so it probably was introduced in a recent commit

Output log or link to your CI build (if appropriate).

No response

@arturcic
Copy link
Member

can you please post the workflow code you have?

@pascalgulikers
Copy link
Author

I was already afraid you were gonna ask, but unfortunately I can't, because it's part of a huge reusable workflow which I can't publicly share, but the gitversion part are these two actions:

- name: Install GitVersion if required
  if: inputs.useGitVersion == 'true'
  uses: gittools/actions/gitversion/setup@v0
  with:
    versionSpec: 5.x
    preferLatestVersion: true

- name: Determine package version with GitVersion
  if: inputs.useGitVersion == 'true'
  id: determine_git_version
  uses: gittools/actions/gitversion/execute@v0

It worked before PR 1070 was merged
I suspect this line: https://github.com/GitTools/actions/pull/1070/files#diff-f25d460f91bbf4450dd61cb84d2b9024daf6510591ee38db94b276624d423bddR27

where the shallow-check was introduced, maybe another version of git is being executed instead of the one in /usr/bin?

@arturcic
Copy link
Member

arturcic commented Mar 12, 2024

please post your checkout step as well

@pascalgulikers
Copy link
Author

- name: Checkout Test GitHub repository
  if: inputs.selfTest == true
  uses: actions/checkout@v4
  with:
    repository: ${{ inputs.selfTestRepo }}
    ref: ${{ inputs.selfTestBranch }}
    token: ${{ env.CUSTOM_TOKEN }}

As you can see, in this case it's checking out other repos than the one where the workflow is running, pretty exotic scenario perhaps..
Furthermore I can confirm that gittools/actions/gitversion/[email protected] works as expected, so this is a workaround for now

@arturcic
Copy link
Member

@pascalgulikers can you test the fix using

uses: gittools/actions/gitversion/setup@main

uses: gittools/actions/gitversion/execute@main

If that works for you I will create a hotfix release

@olibanjoli
Copy link

we're having the same problems

also tried @main:

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup dotnet
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.x

      - name: Install GitVersion
        uses: gittools/actions/gitversion/setup@main
        with:
          versionSpec: 5.x
          preferLatestVersion: true

      - name: Version
        id: gitversion
        uses: gittools/actions/gitversion/execute@main
        with:
          useConfigFile: true

@arturcic
Copy link
Member

we're having the same problems

also tried @main:

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup dotnet
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.x

      - name: Install GitVersion
        uses: gittools/actions/gitversion/setup@main
        with:
          versionSpec: 5.x
          preferLatestVersion: true

      - name: Version
        id: gitversion
        uses: gittools/actions/gitversion/execute@main
        with:
          useConfigFile: true

@olibanjoli I don't see why this does not work for you, as it's basically the same as https://github.com/GitTools/actions/blob/main/.github/workflows/example-8.yml

I will add an input that will allow you to disable the check

arturcic added a commit to arturcic/gittools-actions that referenced this issue Mar 12, 2024
@pascalgulikers
Copy link
Author

pascalgulikers commented Mar 12, 2024

The hotfix seems to work:

Run gittools/actions/gitversion/execute@main
Agent: 'GitHub Actions'
Command: git -C /home/ubuntu/_work/***/*** rev-parse --is-shallow-repository
/usr/bin/git -C /home/ubuntu/_work/***/*** rev-parse --is-shallow-repository
false
Command: dotnet-gitversion /home/ubuntu/_work/***/*** /output json /output buildserver
/home/ubuntu/_work/_tool/GitVersion.Tool/5.12.0/x64/dotnet-gitversion /home/ubuntu/_work/***/*** /output json /output buildserver
INFO [03/12/24 13:46:50:83] Working directory: /home/ubuntu/_work/***/***

@arturcic
Copy link
Member

The hotfix seems to work:

Run gittools/actions/gitversion/execute@main
Agent: 'GitHub Actions'
Command: git -C /home/ubuntu/_work/***/*** rev-parse --is-shallow-repository
/usr/bin/git -C /home/ubuntu/_work/***/*** rev-parse --is-shallow-repository
false
Command: dotnet-gitversion /home/ubuntu/_work/***/*** /output json /output buildserver
/home/ubuntu/_work/_tool/GitVersion.Tool/5.12.0/x64/dotnet-gitversion /home/ubuntu/_work/***/*** /output json /output buildserver
INFO [03/12/24 13:46:50:83] Working directory: /home/ubuntu/_work/***/***

Thank you for confirmation. Anyway I will add the possibility to disable the check, by default it will be checking for shallow clone

@arturcic
Copy link
Member

arturcic commented Mar 12, 2024

we're having the same problems

also tried @main:

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup dotnet
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.x

      - name: Install GitVersion
        uses: gittools/actions/gitversion/setup@main
        with:
          versionSpec: 5.x
          preferLatestVersion: true

      - name: Version
        id: gitversion
        uses: gittools/actions/gitversion/execute@main
        with:
          useConfigFile: true

@olibanjoli can you test with this change?

      - name: Version
        id: gitversion
        uses: gittools/actions/gitversion/execute@main
        with:
          targetPath: gv-repo
          disableShallowCloneCheck: true

and let me know if it works for you?

@arturcic
Copy link
Member

Version 1.1.0 was released. Could you please confirm it fixes your issue?

@olibanjoli
Copy link

it does not work, still the same error:

Run gittools/actions/gitversion/execute@main
  with:
    disableShallowCloneCheck: true
    useConfigFile: true
    disableCache: false
    disableNormalization: false
    configFilePath: GitVersion.yml
    updateAssemblyInfo: false
  env:
    DOTNET_INSTALL_DIR: /home/runner/dotnet
    DOTNET_ROOT: /home/runner/dotnet
    DOTNET_CLI_TELEMETRY_OPTOUT: true
    DOTNET_NOLOGO: true
Agent: 'GitHub Actions'
Command: dotnet-gitversion /actions-runner/_work/***p/***p /output json /output buildserver /config GitVersion.yml
/actions-runner/_work/_tool/GitVersion.Tool/5.1[2](https://github.com/x/actions/runs/8277673615/job/22648456590#step:5:2).0/x64/dotnet-gitversion /actions-runner/_work/***p/***p/output json /output buildserver /config GitVersion.yml
INFO [0[3](https://github.com/p/p/actions/runs/8277673615/job/22648456590#step:5:3)/1[4](https://github.com/x/p/actions/runs/8277673615/job/22648456590#step:5:4)/24 8:31:[5](https://github.com/p/x/actions/runs/8277673615/job/22648456590#step:5:5)0:82] Working directory: /actions-runner/_work/***p/***p
unsupported extension name extensions.worktreeconfig
INFO [03/14/24 8:31:50:85] Done writing 
Error: Error: The process '/actions-runner/_work/_tool/GitVersion.Tool/5.12.0/x[6](https://github.com/p/p/actions/runs/8277673615/job/22648456590#step:5:6)4/dotnet-gitversion' failed with exit code 1

@arturcic
Copy link
Member

can you post here the workflow (the part with the checkout, setup and execute)?

@olibanjoli
Copy link

name: test

on: [push, workflow_dispatch]

jobs:
  build:
    runs-on: self-hosted
    env:
      DOTNET_INSTALL_DIR: "/home/runner/dotnet"
    strategy:
      matrix:
        service:
          - foo
          - bar
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup dotnet
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.x

      - name: Install GitVersion
        uses: gittools/actions/gitversion/setup@main
        with:
          versionSpec: 5.x
          preferLatestVersion: true

      - name: Version
        id: gitversion
        uses: gittools/actions/gitversion/execute@main
        with:
          disableShallowCloneCheck: true
          useConfigFile: true

@pascalgulikers
Copy link
Author

The error is suddenly back:

Run actions/checkout@v4
  with:
    fetch-depth: 0
    fetch-tags: true
    repository: ***/***
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    sparse-checkout-cone-mode: true
    show-progress: true
    lfs: false
    submodules: false
    set-safe-directory: true

/usr/bin/git version
  git version 2.34.1

Run gittools/actions/gitversion/setup@v1
  with:
    versionSpec: 5.x
    preferLatestVersion: true
    includePrerelease: false
    ignoreFailedSources: false

Run gittools/actions/gitversion/execute@v1
  with:
    disableShallowCloneCheck: true
    useConfigFile: false
    disableCache: false
    disableNormalization: false
    configFilePath: GitVersion.yml
    updateAssemblyInfo: false

Resulting in:

INFO [04/22/24 15:49:41:90] Working directory: /home/ubuntu/_work/***/***
unsupported extension name extensions.worktreeconfig
INFO [04/22/24 15:49:41:95] Done writing 
Error: Error: The process '/home/ubuntu/_work/_tool/GitVersion.Tool/5.12.0/x64/dotnet-gitversion' failed with exit code 1

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