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

Submit annotations directly with HTTP #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Submit annotations directly with HTTP #5

wants to merge 2 commits into from

Conversation

sj26
Copy link
Member

@sj26 sj26 commented Sep 7, 2023

I'm not sure yet if this is a good idea, but this branch submits annotations directly via HTTP instead of using the buildkite-agent. I was struggling to get the buildkite-agent binary into a Docker Compose stack, so am trying this out of frustration.

It is potentially breaking -- I had to allow agent.buildkite.com in WebMock in my test suite to allow this to work.

sj26 added 2 commits September 7, 2023 22:29
Using the buildkite-agent is nice in theory, but becomes a pain in
Docker environments. Let's try posting annotations directly to the
Buildkite Agent API. We need some more gems, but they're all
default/stdlib gems which should be installed anyway.
uri = URI.join(agent_endpoint, "v3/jobs/#{ENV.fetch("BUILDKITE_JOB_ID")}/annotations")
headers = {
"Authorization" => "Token #{ENV.fetch("BUILDKITE_AGENT_ACCESS_TOKEN")}",
"User-Agent" => "rspec-buildkite/#{RSpec::Buildkite::VERSION}",
Copy link

Choose a reason for hiding this comment

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

😍

@CaioIcy
Copy link

CaioIcy commented Dec 6, 2023

Small bump to say that this change would be appreciated. Unfortunately, the mount-buildkite-agent does not seem to work for docker-in-docker. The workaround I found is manually installing the agent, which wastes a couple of seconds

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.

3 participants