Skip to content

authd-oidc-brokers/go.mod: Don't replace github.com/canonical/authd#1470

Merged
adombeck merged 1 commit intomainfrom
fix-snap-build
Apr 17, 2026
Merged

authd-oidc-brokers/go.mod: Don't replace github.com/canonical/authd#1470
adombeck merged 1 commit intomainfrom
fix-snap-build

Conversation

@adombeck
Copy link
Copy Markdown
Contributor

Copilot added this in fc86ba7 and we missed it during the review. It breaks the snap build on Launchpad:

:: + go mod download all
:: go: github.com/canonical/authd@v0.6.1 (replaced by ../): reading ../go.mod: open /build/authd-oidc/parts/broker/go.mod: no such file or directory

Copilot added this in fc86ba7 and we
missed it during the review. It breaks the snap build on Launchpad:

  :: + go mod download all
  :: go: github.com/canonical/authd@v0.6.1 (replaced by ../): reading ../go.mod: open /build/authd-oidc/parts/broker/go.mod: no such file or directory
@adombeck adombeck changed the title authd-oidc-brokers/go.mod: Don't replace of github.com/canonical/authd authd-oidc-brokers/go.mod: Don't replace github.com/canonical/authd Apr 16, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.48%. Comparing base (ef4c1de) to head (866665b).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1470   +/-   ##
=======================================
  Coverage   80.48%   80.48%           
=======================================
  Files          20       20           
  Lines        1030     1030           
=======================================
  Hits          829      829           
  Misses        201      201           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nooreldeenmansour
Copy link
Copy Markdown
Member

In #1332, I remember using the replace directive temporarily,

https://github.com/canonical/authd/compare/446f564396d37d80e5133dcb04d933d1adc1663a..0513f0e7a743683788f16ea1671d371a2beff8d4, and had altered the snapcraft.yaml files to be able to do the snap builds (although it was never merged; so not sure if it would have failed on Launchpad)
Would we want to do something like this?

Just commenting as a potential fix/workaround (not sure if we would want to do it)

@adombeck
Copy link
Copy Markdown
Contributor Author

@nooreldeenmansour yeah I'm currently exploring if we want to actually use the authd version from the current repo (I think we do) and how to do that. I have basically the same diff locally as you had on your branch:

diff --git a/snap/variants/google/snapcraft.yaml b/snap/variants/google/snapcraft.yaml
index 7968e889b..1eda79aca 100644
--- a/snap/variants/google/snapcraft.yaml
+++ b/snap/variants/google/snapcraft.yaml
@@ -47,7 +47,7 @@ slots:
 
 parts:
   broker:
-    source: authd-oidc-brokers
+    source: .
     source-type: local
     plugin: nil
     build-snaps:
@@ -55,6 +55,7 @@ parts:
     build-environment:
       - GOBIN: ${CRAFT_PART_INSTALL}/bin
     override-build: |
+      cd authd-oidc-brokers
       go mod download all
       go mod vendor
       VERSION=$(craftctl get version)
diff --git a/snap/variants/msentraid/snapcraft.yaml b/snap/variants/msentraid/snapcraft.yaml
index be58d6028..90521a48d 100644
--- a/snap/variants/msentraid/snapcraft.yaml
+++ b/snap/variants/msentraid/snapcraft.yaml
@@ -66,7 +66,7 @@ parts:
       - -include/**
       - -lib/**.so
   broker:
-    source: authd-oidc-brokers
+    source: .
     source-type: local
     plugin: nil
     build-snaps:
@@ -80,6 +80,7 @@ parts:
       - CGO_LDFLAGS: -L${CRAFT_STAGE}/lib -lhimmelblau
       - GOBIN: ${CRAFT_PART_INSTALL}/bin
     override-build: |
+      cd authd-oidc-brokers
       go mod download all
       go mod vendor
       VERSION=$(craftctl get version)
diff --git a/snap/variants/oidc/snapcraft.yaml b/snap/variants/oidc/snapcraft.yaml
index e05dda0f6..febe1cfa9 100644
--- a/snap/variants/oidc/snapcraft.yaml
+++ b/snap/variants/oidc/snapcraft.yaml
@@ -47,7 +47,7 @@ slots:
 
 parts:
   broker:
-    source: authd-oidc-brokers
+    source: .
     source-type: local
     plugin: nil
     build-snaps:
@@ -55,6 +55,7 @@ parts:
     build-environment:
       - GOBIN: ${CRAFT_PART_INSTALL}/bin
     override-build: |
+      cd authd-oidc-brokers
       go mod download all
       go mod vendor
       VERSION=$(craftctl get version)

@adombeck
Copy link
Copy Markdown
Contributor Author

@nooreldeenmansour in any case, I think we should merge this first to fix the build issue ASAP and then as a follow-up we can look into actually using the local authd version

Copy link
Copy Markdown
Member

@nooreldeenmansour nooreldeenmansour left a comment

Choose a reason for hiding this comment

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

LGTM.
Quick question though that is likely unrelated; running go mod download all changes both the go.sum file. (When run for both the authd and authd-oidc-brokers package). Should we be commiting these?

@adombeck
Copy link
Copy Markdown
Contributor Author

Quick question though that is likely unrelated; running go mod download all changes both the go.sum file. (When run for both the authd and authd-oidc-brokers package). Should we be commiting these?

It's not really clear to me why go mod download all changes the go.sum file, but these changes are undone when running go mod tidy, so no, I don't think we should commit them

@adombeck adombeck merged commit 0343a33 into main Apr 17, 2026
31 of 48 checks passed
@adombeck adombeck deleted the fix-snap-build branch April 17, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants