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

[WIP] Resolve fatal: detected dubious ownership in repository at '/workspace/source' #1359

Closed
wants to merge 1 commit into from
Closed

[WIP] Resolve fatal: detected dubious ownership in repository at '/workspace/source' #1359

wants to merge 1 commit into from

Conversation

coreydaley
Copy link
Contributor

@coreydaley coreydaley commented Aug 15, 2023

Changes

Append git command to add safe.directory of cloned source directory to config, which fixes:

[source-default] 2023/08/14 23:57:02 fatal: detected dubious ownership in repository at '/workspace/source'
#   [source-default] To add an exception for this directory, call:
#   [source-default] 
#   [source-default] 	git config --global --add safe.directory /workspace/source (exit code 128)

Fixes shipwright-io/cli#190

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Add cloned source directory to git config as safe.directory

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 15, 2023
@openshift-ci openshift-ci bot added the release-note Label for when a PR has specified a release note label Aug 15, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 15, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign qu1queee for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coreydaley
Copy link
Contributor Author

/kind failing-test

@openshift-ci openshift-ci bot added the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label Aug 15, 2023
@coreydaley coreydaley changed the title Resolve fatal: detected dubious ownership in repository at '/workspace/source' [WIP] Resolve fatal: detected dubious ownership in repository at '/workspace/source' Aug 15, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 15, 2023
Comment on lines +404 to +407
safeDirectoryArgs := []string{"config", "--global", "--add", "safe.directory", flagValues.target}
if _, err := git(ctx, safeDirectoryArgs...); err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In unit tests, the Git command runs on your local machine. We therefore want to prevent the use of git config --global. The safe.directory configuration is therefore set in the git function itself.

Is the CLI really running on the latest Build code and somehow causes a Git operation to fail with this? If so, then we must look at this specific command. Though, I somehow remember that the CLI runs the latest release in e2e - which would be v0.11? We can have a chat, I wonder if using the latest nightly somehow in the CLI would fix things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. release-note Label for when a PR has specified a release note size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

E2E are failing
2 participants