-
Notifications
You must be signed in to change notification settings - Fork 993
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
Fix: handle corner cases related to SCM with local sources optimization #4249
Fix: handle corner cases related to SCM with local sources optimization #4249
Conversation
… testing the same)
…rls won't be computed properly
… won't match the clause in the exclusion function. Also conditionally compute local_sources_path to scm_url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check broken CI
@@ -20,8 +20,10 @@ class ScmtestConan(ConanFile): | |||
""" | |||
client = TestClient() | |||
client.save({"conanfile.py": conanfile}) | |||
client.runner("git init .", cwd=client.current_folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? The test case was failing even if it wasn't a git repo. Maybe leave the test as it was, and if anything, adding a new one with a git repo too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without creating the Git repository this test fails (because it cannot get the URL to the remote). It is related to the comment about the difficult to understand block. If I execute conditionally that block for Git, then this test (and many others) can be kept as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Maybe an error test, if it is not a git repo, what is the error message. Who is launching it and at which step? Hint: should probably be on export time, not on "create" time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if:
- URL is defined hardcoded with full url, not "auto"
- revision=auto
# Generate the scm_folder.txt file pointing to the src_path | ||
src_path = scm.get_repo_root() | ||
save(scm_src_file, src_path.replace("\\", "/")) | ||
captured = scm_data.capture_origin or scm_data.capture_revision | ||
|
||
if scm_data.url == "auto": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check with a test of export+upload, without having a remote repo origin, and it should fail.
@@ -20,8 +20,10 @@ class ScmtestConan(ConanFile): | |||
""" | |||
client = TestClient() | |||
client.save({"conanfile.py": conanfile}) | |||
client.runner("git init .", cwd=client.current_folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Maybe an error test, if it is not a git repo, what is the error message. Who is launching it and at which step? Hint: should probably be on export time, not on "create" time.
@@ -20,8 +20,10 @@ class ScmtestConan(ConanFile): | |||
""" | |||
client = TestClient() | |||
client.save({"conanfile.py": conanfile}) | |||
client.runner("git init .", cwd=client.current_folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if:
- URL is defined hardcoded with full url, not "auto"
- revision=auto
I've added some tests and modified one behavior after talking with @memsharded; please @lasote have a look at them and let us know your opinion:
|
Changelog: Fix: Handle corner cases related to SCM with local sources optimization
Docs: Omit
closes [SVN] Optimization on SCM ('scm_folder.txt') breaks url "auto" on monorepo (some use-cases) #4222
closes? [SCM][SVN] Support working in a mono-repo checkout #3786
closes? Behaviour of scm plugin for specific commit with local build subdirectory #4139
It should fix some tests in PR #4193
Note to reviewers, these are the steps to follow:
@tags: svn