Skip to content

fix: extend multi git server support to Azure devOps - #8063

Merged
jedevc merged 3 commits into
dagger:mainfrom
grouville:ref-azure
Aug 1, 2024
Merged

jedevc merged 3 commits into
dagger:mainfrom
grouville:ref-azure

Conversation

@grouville

Copy link
Copy Markdown
Member

When working on private SSH support, I realized that our support for Azure refs is broken on monorepos.

Why ?
Azure's handling of go-get=1 is not foolproof:

  1. repoRootForImportPath does work well on refs leading to a repo, infering properly the vcs provider used
  2. But, go-get=1 returns a 500 when a subpath is included
  3. Azure ref's style is explicit with the vcs being used: git is mentioned for a git based repo

If we are ok with this explicitness, we should not try to infer the vcs based on the go-get for Azure and rely on regexes

@grouville
grouville marked this pull request as ready for review July 31, 2024 06:13
@grouville grouville changed the title feat: extend multi git server support to Azure devOps fix: extend multi git server support to Azure devOps Jul 31, 2024

@jedevc jedevc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, a couple tiny nits 🎉

Good catch!

Comment thread core/integration/module_config_test.go Outdated
Comment on lines +1432 to +1439
var expectedURL string
if tc.expectedHost == "dev.azure.com" {
expectedURL = fmt.Sprintf("https://%s/%s/%s", tc.expectedBaseHTMLURL, tc.expectedURLPathComponent, tc.gitTestRepoCommit)
} else {
expectedURL = fmt.Sprintf("https://%s/%s/%s", tc.expectedBaseHTMLURL, tc.expectedURLPathComponent, tc.gitTestRepoCommit)
}
require.Equal(t, expectedURL, htmlURL)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These are the same in both branches?

Instead of hardcoding dev.azure.com here, we could potentially have a expectedPathPrefix property or something in the test case, and the have that set to ?path= for azure (and left empty for the others)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done 🙏

Comment thread engine/vcs/vcs.go
// HTTPS ref
{
prefix: "dev.azure.com/",
re: `^(?P<root>dev\.azure\.com/(?P<account>[A-Za-z0-9_.\-]+)(/(?P<project>[A-Za-z0-9_.\-]+))?/_git/(?P<repo>[A-Za-z0-9_.\-]+)(\.git)?)(/[\p{L}0-9_.\-]+)*(/.*)?$`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I shall trust you on this 😆

body: |
feat: extend multi git server support to Azure devOps

Our support for Azure refs is broken on monorepos, as Azure returns a 500 when we query a ref containing a subpath with `go-get=1`. Instead, we rely on regexes to infer the root of the repo and the subpath from the ref

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Our support for Azure refs is broken on monorepos, as Azure returns a 500 when we query a ref containing a subpath with `go-get=1`. Instead, we rely on regexes to infer the root of the repo and the subpath from the ref
Our support for Azure refs was broken on monorepos, as Azure returns a 500 when we query a ref containing a subpath with `go-get=1`. Instead, we rely on regexes to infer the root of the repo and the subpath from the ref

I don't know if we need the detail about 500s, we can just say we special-case azure dev-ops since it doesn't work with the go standard convention of discovering the root of a git repository.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed, you're right, it is better 🙏

@grouville
grouville force-pushed the ref-azure branch 2 times, most recently from 6ce32dd to 444128a Compare July 31, 2024 18:12
@grouville
grouville requested a review from jedevc July 31, 2024 18:13
@samalba samalba added the kind/bug Something isn't working label Jul 31, 2024
When working on private SSH support, I realized that our support for Azure refs is broken on monorepos.

Why ? Azure's handling of `go-get=1` is not foolproof:
1. repoRootForImportPath does work well on refs leading to a repo,
   infering properly the vcs provider used
2. But,  go-get=1 returns a 500 when a subpath is included
3. Azure ref's style is explicit with the vcs being used: git is
   mentioned for a git based repo

If we are ok with this explicitness, we should not try to infer the vcs
based on the go-get for Azure and rely on regexes

Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
@grouville

Copy link
Copy Markdown
Member Author

Failures are unrelated 🙏

@jedevc

jedevc commented Aug 1, 2024

Copy link
Copy Markdown
Contributor

Awesome awesome, let's get this for the release today 🎉

@jedevc
jedevc merged commit 94ae7b4 into dagger:main Aug 1, 2024
renovate Bot referenced this pull request in scottames/daggerverse Aug 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [dagger/dagger](https://togithub.com/dagger/dagger) | patch |
`v0.12.3` -> `v0.12.4` |

---

### Release Notes

<details>
<summary>dagger/dagger (dagger/dagger)</summary>

###
[`v0.12.4`](https://togithub.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0124---2024-08-01)

[Compare
Source](https://togithub.com/dagger/dagger/compare/v0.12.3...v0.12.4)

##### Changed

- Deprecate old `pipeline` APIs by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/8064](https://togithub.com/dagger/dagger/pull/8064)
\
These operations have been no-ops since v0.11.0, and will be removed in
v0.13.0.

##### Fixed

- Fix errors when using Dockerfile builds from module functions that
have secrets by [@&#8203;sipsma](https://togithub.com/sipsma) in
[https://github.com/dagger/dagger/pull/8049](https://togithub.com/dagger/dagger/pull/8049)
- Fix dagger `terminal` prompt with debian-based images by
[@&#8203;vmaffet](https://togithub.com/vmaffet) in
[https://github.com/dagger/dagger/pull/7960](https://togithub.com/dagger/dagger/pull/7960)
- Fix occasional leaks in secret scrubbing algorithm by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/8047](https://togithub.com/dagger/dagger/pull/8047)
- Fix frequent context switches in `--progress=plain` output by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/7956](https://togithub.com/dagger/dagger/pull/7956)
- Extend multi git server support to Azure devOps by
[@&#8203;grouville](https://togithub.com/grouville) in
[https://github.com/dagger/dagger/pull/8063](https://togithub.com/dagger/dagger/pull/8063)
\
Our support for Azure refs was broken on monorepos. We special-case
Azure
DevOps since it doesn't work with the go standard convention of
discovering
    the root of a git repository

##### What to do next?

-   Read the [documentation](https://docs.dagger.io)
-   Join our [Discord server](https://discord.gg/dagger-io)
-   Follow us on [Twitter](https://twitter.com/dagger_io)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone
America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/scottames/daggerverse).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
scottames referenced this pull request in scottames/containers Aug 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [dagger/dagger](https://togithub.com/dagger/dagger) | patch |
`v0.12.3` -> `v0.12.4` |

---

### Release Notes

<details>
<summary>dagger/dagger (dagger/dagger)</summary>

###
[`v0.12.4`](https://togithub.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0124---2024-08-01)

[Compare
Source](https://togithub.com/dagger/dagger/compare/v0.12.3...v0.12.4)

##### Changed

- Deprecate old `pipeline` APIs by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/8064](https://togithub.com/dagger/dagger/pull/8064)
\
These operations have been no-ops since v0.11.0, and will be removed in
v0.13.0.

##### Fixed

- Fix errors when using Dockerfile builds from module functions that
have secrets by [@&#8203;sipsma](https://togithub.com/sipsma) in
[https://github.com/dagger/dagger/pull/8049](https://togithub.com/dagger/dagger/pull/8049)
- Fix dagger `terminal` prompt with debian-based images by
[@&#8203;vmaffet](https://togithub.com/vmaffet) in
[https://github.com/dagger/dagger/pull/7960](https://togithub.com/dagger/dagger/pull/7960)
- Fix occasional leaks in secret scrubbing algorithm by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/8047](https://togithub.com/dagger/dagger/pull/8047)
- Fix frequent context switches in `--progress=plain` output by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/7956](https://togithub.com/dagger/dagger/pull/7956)
- Extend multi git server support to Azure devOps by
[@&#8203;grouville](https://togithub.com/grouville) in
[https://github.com/dagger/dagger/pull/8063](https://togithub.com/dagger/dagger/pull/8063)
\
Our support for Azure refs was broken on monorepos. We special-case
Azure
DevOps since it doesn't work with the go standard convention of
discovering
    the root of a git repository

##### What to do next?

-   Read the [documentation](https://docs.dagger.io)
-   Join our [Discord server](https://discord.gg/dagger-io)
-   Follow us on [Twitter](https://twitter.com/dagger_io)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone
America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/scottames/containers).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
scottames referenced this pull request in scottames/dots Aug 10, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [dagger/dagger](https://togithub.com/dagger/dagger) | patch |
`v0.12.3` -> `v0.12.4` |

---

### Release Notes

<details>
<summary>dagger/dagger (dagger/dagger)</summary>

###
[`v0.12.4`](https://togithub.com/dagger/dagger/blob/HEAD/CHANGELOG.md#v0124---2024-08-01)

[Compare
Source](https://togithub.com/dagger/dagger/compare/v0.12.3...v0.12.4)

##### Changed

- Deprecate old `pipeline` APIs by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/8064](https://togithub.com/dagger/dagger/pull/8064)
\
These operations have been no-ops since v0.11.0, and will be removed in
v0.13.0.

##### Fixed

- Fix errors when using Dockerfile builds from module functions that
have secrets by [@&#8203;sipsma](https://togithub.com/sipsma) in
[https://github.com/dagger/dagger/pull/8049](https://togithub.com/dagger/dagger/pull/8049)
- Fix dagger `terminal` prompt with debian-based images by
[@&#8203;vmaffet](https://togithub.com/vmaffet) in
[https://github.com/dagger/dagger/pull/7960](https://togithub.com/dagger/dagger/pull/7960)
- Fix occasional leaks in secret scrubbing algorithm by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/8047](https://togithub.com/dagger/dagger/pull/8047)
- Fix frequent context switches in `--progress=plain` output by
[@&#8203;jedevc](https://togithub.com/jedevc) in
[https://github.com/dagger/dagger/pull/7956](https://togithub.com/dagger/dagger/pull/7956)
- Extend multi git server support to Azure devOps by
[@&#8203;grouville](https://togithub.com/grouville) in
[https://github.com/dagger/dagger/pull/8063](https://togithub.com/dagger/dagger/pull/8063)
\
Our support for Azure refs was broken on monorepos. We special-case
Azure
DevOps since it doesn't work with the go standard convention of
discovering
    the root of a git repository

##### What to do next?

-   Read the [documentation](https://docs.dagger.io)
-   Join our [Discord server](https://discord.gg/dagger-io)
-   Follow us on [Twitter](https://twitter.com/dagger_io)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone
America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/scottames/dots).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants