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

use new build version feature #397

Merged
merged 10 commits into from
Feb 20, 2025
Merged

use new build version feature #397

merged 10 commits into from
Feb 20, 2025

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Feb 18, 2025

Go 1.24 is now injecting the build version into the binary, so we don't need to do this extra work.

I think this may also fix #233, allowing us to ask people to run dependabot --version to check to see if they're running an old version of the Dependabot CLI. Currently it does not work if they do the go install command.

Also updated the installation instructions, removed a gist from a former employee.

@jakecoffman jakecoffman requested a review from a team as a code owner February 18, 2025 14:04
jeffwidman
jeffwidman previously approved these changes Feb 18, 2025
Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Nice, glad they finally added that!

@jakecoffman
Copy link
Member Author

I added a test and found that on our CI it's not working. Still this is an improvement!

@jakecoffman jakecoffman marked this pull request as ready for review February 18, 2025 19:35
@@ -12,7 +12,7 @@ import (
)

func TestDependabot(t *testing.T) {
err := exec.Command("go", "build", "dependabot.go").Run()
err := exec.Command("go", "build", ".").Run()
Copy link
Member Author

Choose a reason for hiding this comment

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

When you build with a file, the version info isn't injected.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I remember hitting something like this at a prior employer. It was a royal pain to workaround.

@@ -24,7 +24,7 @@ func TestDependabot(t *testing.T) {
engine := &script.Engine{
Conds: scripttest.DefaultConds(),
Cmds: Commands(),
Quiet: !testing.Verbose(),
Quiet: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Having it always output the failing test is helpful, making it permanent.

@jakecoffman jakecoffman added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit c149fb5 Feb 20, 2025
3 checks passed
@jakecoffman jakecoffman deleted the build-version branch February 20, 2025 21:08
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.

change the build-from-source instructions
2 participants