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

atlantis: 0.22.3 -> 0.27.0 #279776

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

siddharthdhakane
Copy link
Member

@siddharthdhakane siddharthdhakane commented Jan 9, 2024

Description of changes

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

Sorry, something went wrong.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jan 9, 2024
@ofborg ofborg bot requested a review from jpotier January 9, 2024 09:55
@siddharthdhakane siddharthdhakane marked this pull request as ready for review January 9, 2024 12:05
Copy link
Contributor

@jpotier jpotier left a comment

Choose a reason for hiding this comment

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

nix run https://codeload.github.com/siddharthdhakane/nixpkgs/zip/refs/heads/update-atlantis#atlantis -- version
atlantis 0.27.0 (commit: none) (build date: unknown)

Builds and runs

@delroth delroth added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Jan 9, 2024
Comment on lines 14 to 16
patchPhase = ''
substituteInPlace main.go --replace dev ${version}
'';
Copy link
Contributor

@thiagokokada thiagokokada Jan 9, 2024

Choose a reason for hiding this comment

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

Can you set using it with Go flags instead?

Suggested change
patchPhase = ''
substituteInPlace main.go --replace dev ${version}
'';
ldflags = [ "-X=main.version=${version}" ];

(I am not 100% sure if this works in non-public vars, but we should at least try).

BTW, we probably also should set the commit and date (with Unix epoch) flags: https://github.com/runatlantis/atlantis/blob/main/main.go#L30-L32

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/runatlantis/atlantis/blob/cea2db5fb0690b91f85f5da8cb0113a2cfac0e5c/Dockerfile#L40

It definitely seems to work, so we should use it instead of fragile substituteInPlace hacks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding date will make this impure. Also, fetchFromGithub doesn't give you any information about the commit ID. Hardcoding the commit ID or switching to fetchgit just to add this output to the version subcommand is excessive.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding date will make this impure.

This is why I suggested to use the Unix Epoch: https://en.wikipedia.org/wiki/Unix_time, not the actual build time.

Also, fetchFromGithub doesn't give you any information about the commit ID. Hardcoding the commit ID or switching to fetchgit just to add this output to the version subcommand is excessive.

This is fair enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added the date in the RFC3339 format as recommended here.

@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 10, 2024
@ofborg ofborg bot requested a review from jpotier January 10, 2024 08:32
@delroth delroth added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Jan 10, 2024
@thiagokokada
Copy link
Contributor

Result of nixpkgs-review pr 279776 run on aarch64-darwin 1

1 package built:
  • atlantis

Comment on lines 13 to 14
date = "1970-01-01T00:00:00Z";
ldflags = [ "-X=main.version=${version}" "-X=main.date=${date}"];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
date = "1970-01-01T00:00:00Z";
ldflags = [ "-X=main.version=${version}" "-X=main.date=${date}"];
ldflags = [
"-X=main.version=${version}"
"-X=main.date=1970-01-01T00:00:00Z"
];

There is no need to add date as an attr to the derivation

@delroth delroth removed the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Jan 10, 2024
@delroth delroth added the 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people label Jan 10, 2024
@thiagokokada thiagokokada merged commit 94cc012 into NixOS:master Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 10.rebuild-linux: 1 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants