Skip to content

ory: 0.3.4 -> v1.1.0 #403778

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nicolas-goudry
Copy link
Contributor

Changes introduced

  • update ory to v1.1.0
  • use finalAttrs instead of rec
  • remove useless subPackages
  • add ldflags
  • disable Go tests and use versionCheckHook to check successful build(see below notes)
  • add updateScript
  • avoid scoping with lib

Notes for reviewers

  1. version is now using a leading v char because, without it, the checkPhase fails with the following error:
       > Running phase: checkPhase
       >
       > The configuration contains values or keys which are invalid:
       > version: 1.1.0
       >          ^-- does not match pattern "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
       >
       > time=2025-05-02T22:59:27Z level=fatal msg=Unable to load config. audience=application error=map[message:I[#/version] S[#/properties/version/pattern] does not match pattern "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"] service_name= service_version
=
       > FAIL    github.com/ory/cli/cmd  0.058s
       > FAIL

I didn’t find another way than setting the derivation version field to v1.1.0. This might not be needed after all (see item 2 below).

  1. Go tests are entirely disabled because I wasn’t able to make them work with checkFlags. For some reason unknown to me, even if I provide the -skip flag, tests are still run. Here is the checkFlags content and the build output (with NIX_DEBUG=1):
checkFlags = [
  "-skip=TestMain"
];
$WORK/b001/accountexperience.test -test.paniconexit0 -test.timeout=10m0s -test.skip=TestMain
rm -rf $WORK/b001/

        Error Trace:    /build/source/cmd/cloudx/testhelpers/testhelpers.go:210
                                                /build/source/cmd/cloudx/testhelpers/testmain.go:44
                                                /build/source/cmd/cloudx/accountexperience/accountexperience_test.go:29
        Error:          Received unexpected error:
                        Get "https://project.console.staging.ory.dev/self-service/registration/api": dial tcp: lookup project.console.staging.ory.dev on [::1]:53: read udp [::1]:34005->[::1]:53: read: connection refused
        Test:           TestMain

goroutine 1 [running]:
runtime/debug.Stack()
        /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
        /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/debug/stack.go:18 +0x13
github.com/ory/cli/cmd/cloudx/testhelpers.MockTestingTForMain.Errorf({{0xc0019879c8?, 0x2?}}, {0x1ed8446?, 0x480a05?}, {0xc001a920f0?, 0x1af9a20?, 0x101?})
        /build/source/cmd/cloudx/testhelpers/testmain.go:87 +0x4c
github.com/stretchr/testify/assert.Fail({0x7fffa8fc1020, 0xc000f64b90}, {0xc00052e2a0, 0xde}, {0x0, 0x0, 0x0})
        /build/source/vendor/github.com/stretchr/testify/assert/assertions.go:363 +0x370
github.com/stretchr/testify/assert.NoError({0x7fffa8fc1020, 0xc000f64b90}, {0x24ee3e0, 0xc001a94330}, {0x0, 0x0, 0x0})
        /build/source/vendor/github.com/stretchr/testify/assert/assertions.go:1545 +0x125
github.com/stretchr/testify/require.NoError({0x24f7360, 0xc000f64b90}, {0x24ee3e0, 0xc001a94330}, {0x0, 0x0, 0x0})
        /build/source/vendor/github.com/stretchr/testify/require/require.go:1354 +0xb0
github.com/ory/cli/cmd/cloudx/testhelpers.RegisterAccount({0x2504e38, 0x3ac53c0}, {0x251b060, 0xc000f64b90})
        /build/source/cmd/cloudx/testhelpers/testhelpers.go:210 +0x1a5
github.com/ory/cli/cmd/cloudx/testhelpers.CreateDefaultAssetsBrowser()
        /build/source/cmd/cloudx/testhelpers/testmain.go:44 +0x112
github.com/ory/cli/cmd/cloudx/accountexperience_test.TestMain(0xc000f26dc0)
        /build/source/cmd/cloudx/accountexperience/accountexperience_test.go:29 +0x1c
main.main()
        _testmain.go:49 +0xa8
FAIL    github.com/ory/cli/cmd/cloudx/accountexperience 0.053s
FAIL

The versionCheckHook tester is used instead, to ensure the built binary is working.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 2, 2025
@nix-owners nix-owners bot requested a review from luleyleo May 2, 2025 23:18
@nicolas-goudry
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 403778


x86_64-linux

✅ 1 package built:
  • ory

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5451

@pbsbot
Copy link

pbsbot commented May 31, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 403778
Commit: d48a686443eadb776b83677c96ead80c87f40613


x86_64-linux

❌ 1 package failed to build:
  • ory
source> trying https://github.com/ory/cli/archive/refs/tags/vv1.1.0.tar.gz
source>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
source>                                  Dload  Upload   Total   Spent    Left  Speed
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source> curl: (22) The requested URL returned error: 404
source> Warning: Problem (retrying all errors). Will retry in 1 second. 3 retries left.
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source> curl: (22) The requested URL returned error: 404
source> Warning: Problem (retrying all errors). Will retry in 2 seconds. 2 retries
source> Warning: left.
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source> curl: (22) The requested URL returned error: 404
source> Warning: Problem (retrying all errors). Will retry in 4 seconds. 1 retry left.
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source> curl: (22) The requested URL returned error: 404
source> error: cannot download source from any mirror

the source url has a double v prefix.

pname = "ory";
version = "0.3.4";
version = "v1.1.0";
Copy link
Member

Choose a reason for hiding this comment

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

i would really like to avoid the v prefix

ldflags = [
"-s"
"-w"
"-X github.com/ory/cli/buildinfo.Version=${finalAttrs.version}"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"-X github.com/ory/cli/buildinfo.Version=${finalAttrs.version}"
"-X github.com/ory/cli/buildinfo.Version=v${finalAttrs.version}"

does this work? Anywhere else that could be patched, or is there some environment variable we could set?

tag = "v${version}";
hash = "sha256-q7+Fpttgx62GbKxCCiEDlX//e/pNO24e7KhhBeGRDH0=";
tag = "v${finalAttrs.version}";
hash = "sha256-+Su2FIuCb2vpPW/OCOTzqQOZPpY9gGRbwylSepLh2hk=";
Copy link
Member

Choose a reason for hiding this comment

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

you have to reset the hash every time you make a change to the fetcher inputs to test it

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants