Skip to content

How to compile & build, including notifiers? #95

Closed

Description

@emcniece

I'm trying to make some adjustments to the Slack notifier, but my changes aren't being reflected in the build. I must be missing something, maybe there's some Golang package/include behaviour that I don't understand.

How can we build the project with the top-level slack.go file?

My process so far:

# Download the project
git clone https://github.com/sourcegraph/checkup.git
cd checkup

# ... make some changes to ./slack.go - ie. changed the title of the message that gets posted,
# line 34 from "Status" to "Statusss"
# Also add several log lines, both `fmt.Printf` and `log.Printf`

# ... also create a ./checkup.json file with an intentionally-failing check and a valid notifier

# Build locally, as per docs
cd cmd/checkup/
go get -v -d
go build -v -ldflags '-s' -o ../../checkup

# Move back up and test the binary
cd ../../
./checkup 

== Fake Website - https://fake.site
  Threshold: 0s
        Max: 28.6472ms
        Min: 28.6472ms
     Median: 28.6472ms
       Mean: 28.6472ms
        All: [{28.6472ms Get https://fake.site: dial tcp: lookup fake.site on 192.168.65.1:53: no such host}]
 Assessment: down

# All done - check Slack for message.

The message is posted to Slack, but the title isn't the modified "Statusss" that I expect. I also don't see any of the debug logs that I inserted.

Am I missing a step to properly include the Slack notifier in a build? Is it imported from somewhere not local?

Activity

  1. mattberther commented on Oct 14, 2019

    @mattberther
    Contributor

    I encountered this earlier when implementing #100. Specifically, I was cloning it, like you, outside of my GOPATH.

    The trick for me was following the Getting Started steps (using go get to have it in my GOAPTH) from https://github.com/sourcegraph/checkup/blob/master/CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions