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

chore: add instructions for making changes and deploying` #322

Open
wants to merge 2 commits into
base: entities
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,24 @@ Go client for the Yext API

[![GoDoc](https://godoc.org/github.com/yext/yext-go?status.svg)](https://godoc.org/github.com/yext/yext-go)
[![Build Status](https://travis-ci.org/yext/yext-go.svg?branch=v2)](https://travis-ci.org/yext/yext-go)

## How to Use Locally With Congo
* `cd` into this repo's root
* checkout the latest changes: `git checkout entities && git pull`
* run `go mod init gopkg.in/yext/yext-go.v2` to initialize the repo as a Go module
* run `echo "\nreplace gopkg.in/yext/yext-go.v2 => $(pwd)/ // TODO($(whoami)): REMOVE! DO NOT MERGE" >> "$CONGO/go.mod"`
* This tells Go to use your local changes instead of the fetched package
* **Don't forget to remove that line before making any commits to Congo**
* You should be able to `cmd + click` on anything that lives in `yext-go` like `yext.Entity` and your IDE should show your local path in the crumbs/file path
* If you still see `gopkg.in/yext/[email protected]` type of paths, you might need to run run `cd $CONGO && go mod tidy` to fix the issue
* The correct path will match what is added to the bottom of `$CONGO/go.mod` ex: `/Users/myuser/repo/yext-go`

## Deploying Changes
* Ensure your `$CONGO/go.mod` does NOT have the `replace` line with your local `yext-go` path from the section above
* Open the new commit you want ship in `git log` or Github and copy the commit hash
* ex: `2e0a9278c9e8d6a354566770512f92e4822a0f6e`
* Then run `cd $CONGO && go get gopkg.in/yext/yext-go.v2@COMMIT_HASH` with `COMMIT_HASH` swapped for hash you just copied
* ex: `go get gopkg.in/yext/yext-go.v2@2e0a9278c9e8d6a354566770512f92e4822a0f6e`
* run `make updategomod updatedepsbzl` to update the go mod/sum and bazel files
* make a commit with those changes, wait for `+1` from CongoTestBed and then you should be good to ship it 🥳
* ex: https://gerrit.yext.com/c/congo/+/259564