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

chore: new googleCloudBuildRepoV2 field to configure a remote dependency #9293

Conversation

renzodavid9
Copy link
Contributor

@renzodavid9 renzodavid9 commented Feb 2, 2024

Related: #9236

Description

  • Add a new requires[].googleCloudBuildRepoV2 config key to allow a remote dependency configuration using Google Cloud Build Repositories V2
  • Changes in the gitutil package to be able to handle the case when we have a URI with the oauth2 format. Now the package defines the struct it accepts to download/sync a repo instead of using the latest.GitInfo from the yaml schema, leaving only the necessary fields it needs
  • Now when the gitutil package detects that the repo needs to be sync (instead of cloned), it will try to change the remote origin URL before triggering git fetch and git reset. This to handle the case when we use oauth2, the read token can expire, so we need to use the new one fetched from CB
  • If the same repo, e.g, https://github.com/org/repo.git, is configured with requires[].googleCloudBuildRepoV2 and requires[].git, the generated folder name will be the same for both due to they use the same inputs to generate the hash (repo + ref). This shouldn't be a problem due to is the same source, and what will change is the remote origin URL to use, or not, the oauth2 format
  • The integration test is using skaffold render to check that the remote dependency was fetched correctly

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

Attention: 295 lines in your changes are missing coverage. Please review.

Comparison is base (290280e) 70.48% compared to head (93d7e21) 63.55%.
Report is 1113 commits behind head on main.

Files Patch % Lines
cmd/skaffold/app/cmd/exec.go 16.32% 40 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/filter.go 47.27% 22 Missing and 7 partials ⚠️
cmd/skaffold/app/cmd/lsp.go 28.12% 23 Missing ⚠️
cmd/skaffold/app/cmd/verify.go 23.33% 23 Missing ⚠️
cmd/skaffold/app/cmd/fix.go 51.16% 17 Missing and 4 partials ⚠️
cmd/skaffold/app/cmd/inspect_job_manifest_paths.go 60.00% 15 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/inspect_namespaces.go 50.00% 13 Missing and 1 partial ⚠️
...md/skaffold/app/cmd/inspect_config_dependencies.go 45.83% 12 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/lint.go 42.85% 12 Missing ⚠️
cmd/skaffold/app/cmd/inspect_build_env.go 60.71% 11 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9293      +/-   ##
==========================================
- Coverage   70.48%   63.55%   -6.94%     
==========================================
  Files         515      635     +120     
  Lines       23150    32804    +9654     
==========================================
+ Hits        16317    20847    +4530     
- Misses       5776    10348    +4572     
- Partials     1057     1609     +552     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renzodavid9 renzodavid9 force-pushed the issue-9236-gcbrepov2-dependency-schema branch from 61ed1d2 to 9de8a98 Compare February 7, 2024 00:06
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 7, 2024
@renzodavid9 renzodavid9 force-pushed the issue-9236-gcbrepov2-dependency-schema branch 2 times, most recently from a65f10f to cc16819 Compare February 7, 2024 15:16
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Feb 7, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Feb 7, 2024
@renzodavid9 renzodavid9 force-pushed the issue-9236-gcbrepov2-dependency-schema branch from cc16819 to b299793 Compare February 7, 2024 17:41
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Feb 7, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Feb 7, 2024
@renzodavid9 renzodavid9 marked this pull request as ready for review February 7, 2024 20:29
@renzodavid9 renzodavid9 merged commit 0a1f317 into GoogleContainerTools:main Feb 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants