devspace icon indicating copy to clipboard operation
devspace copied to clipboard

fix: devspace deploy do git pull for cached dependencies

Open Andrioden opened this issue 2 years ago • 5 comments

What issue type does this pull request address? /kind bugfix /kind enhancement

What does this pull request do? Which issues does it resolve? resolves #2765

Please provide a short message that should be published in the DevSpace release notes Same as PR title

What else do we need to know? Alternatively the PR https://github.com/devspace-sh/devspace/pull/2709 could be straight up reverted. As reverting would be (i think) functionally the same as this PR. However, it does not read very well. It was not a coincidence that i misunderstood the "git clone" code path of DownloadDependency that i was attempting to fix in my last pr, thought, I am no go developer and are in that sense reading and writing code with a handicap. :P

Testing As I am not able to write integration tests, i have manually tested a locally built devspace.exe:

  • It correctly git clone repos when i delete .dependencies folder
  • It correctly reclone git repo when a branch is changed
  • It correctly git pull cached dependencies
  • It respects the dependency.disablePull flag by not pulling when its true
  • It correctly tries to switch the url type (switchURLType(gitPath))

Andrioden avatar Dec 04 '23 18:12 Andrioden

Deploy Preview for devspace-docs ready!

Built without sensitive environment variables

Name Link
Latest commit 52f0ee4594edf266fe0f9f34fabaf3e73b7edb04
Latest deploy log https://app.netlify.com/sites/devspace-docs/deploys/65c0abe8679c510008d999a5
Deploy Preview https://deploy-preview-2766--devspace-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Dec 04 '23 18:12 netlify[bot]

Will look at this again later this week

Andrioden avatar Jan 22 '24 12:01 Andrioden

ℹ️ Output from newest testing/code, looks good (with considerations within the scope of this PR). Nothing is cloned twice, the amount of pulls are as expected.

14:35:39 debug Cloned https://[email protected]/nhnfelles/Helsenorge/_git/HN-Configuration
14:35:41 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Configuration
14:35:42 debug Cloned https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
14:35:43 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
14:35:45 debug Cloned https://[email protected]/nhnfelles/Helsenorge/_git/HN-FellesKonfig
14:35:46 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-FellesKonfig
14:35:48 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
14:35:50 debug Cloned https://[email protected]/nhnfelles/Helsenorge/_git/HN-Felleslogg
14:35:51 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Felleslogg
14:35:52 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
14:35:58 debug Cloned https://[email protected]/nhnfelles/Helsenorge/_git/HN-Personvern
14:35:59 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Personvern
14:36:01 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
14:36:07 debug Cloned https://[email protected]/nhnfelles/Helsenorge/_git/HN-STS
14:36:08 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-STS
14:36:09 debug Pulled https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett

Andrioden avatar Jan 29 '24 13:01 Andrioden

I believe this is ready for merge @lizardruss (just remember to Squash)

Andrioden avatar Feb 01 '24 15:02 Andrioden

@lizardruss - Fixed lint errors, at least i think i have, i was not able to reproduce them locally, and the workflow here is not run until you trigger them.

Andrioden avatar Feb 05 '24 09:02 Andrioden

@lizardruss - Any chance this could be merged?

Andrioden avatar Feb 19 '24 12:02 Andrioden