Skip to content

Commit

Permalink
[chore] Simplify contribution / Usage (open-telemetry#6975)
Browse files Browse the repository at this point in the history
Looking to reduce contribution toil and reducing onboarding efforts, this removes any additional once of steps that could cause issues with tooling versioning mismatches.
  • Loading branch information
MovieStoreGuy committed Jan 19, 2023
1 parent 5358eb9 commit 4f5412e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 21 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Install-Tools
run: |
cd ${{ github.base_ref }}
make install-tools

# Generate apidiff states of Main
- name: Generate-States
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make gomoddownload
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools

lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,9 @@ $ git remote add fork [email protected]:YOUR_GITHUB_USERNAME/opentelemetry-collecto
Run tests, fmt and lint:

```shell
$ make install-tools # Only first time.
$ make
```

*Note:* the default build target requires tools that are installed at `$(go env
GOPATH)/bin`, ensure that `$(go env GOPATH)/bin` is included in your `PATH`.

## Creating a PR

Checkout a new branch, make modifications, build locally, and push the branch to your fork
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gobenchmark:
@$(MAKE) for-all-target TARGET="benchmark"

.PHONY: gotest-with-cover
gotest-with-cover:
gotest-with-cover: $(GOCOVMERGE)
@$(MAKE) for-all-target TARGET="test-with-cover"
$(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt

Expand Down Expand Up @@ -339,7 +339,7 @@ checkdoc:

# Construct new API state snapshots
.PHONY: apidiff-build
apidiff-build:
apidiff-build: $(APIDIFF)
@$(foreach pkg,$(ALL_PKGS),$(call exec-command,./internal/buildscripts/gen-apidiff.sh -p $(pkg)))

# If we are running in CI, change input directory
Expand All @@ -351,7 +351,7 @@ endif

# Compare API state snapshots
.PHONY: apidiff-compare
apidiff-compare:
apidiff-compare: $(APIDIFF)
@$(foreach pkg,$(ALL_PKGS),$(call exec-command,./internal/buildscripts/compare-apidiff.sh -p $(pkg)))

.PHONY: multimod-verify
Expand All @@ -368,9 +368,9 @@ multimod-prerelease: $(MULTIMOD)
COMMIT?=HEAD
REMOTE?[email protected]:open-telemetry/opentelemetry-collector.git
.PHONY: push-tags
push-tags:
multimod verify
set -e; for tag in `multimod tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \
push-tags: $(MULTIMOD)
$(MULTIMOD) verify
set -e; for tag in `$(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \
echo "pushing tag $${tag}"; \
git push ${REMOTE} $${tag}; \
done;
Expand Down
1 change: 1 addition & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GOIMPORTS := $(TOOLS_BIN_DIR)/goimports
MULTIMOD := $(TOOLS_BIN_DIR)/multimod
CROSSLINK := $(TOOLS_BIN_DIR)/crosslink
CHLOG := $(TOOLS_BIN_DIR)/chloggen
APIDIFF := $(TOOLS_BIN_DIR)/apidiff

GH := $(shell which gh)

Expand Down
4 changes: 2 additions & 2 deletions internal/buildscripts/compare-apidiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ usage() {
package=""
input_dir="./internal/data/apidiff"
check_only=false

apidiff_cmd="$(dirname $(realpath ${BASH_SOURCE:-$0}))/../../.tools/apidiff"

while getopts "cp:d:" o; do
case "${o}" in
Expand All @@ -41,7 +41,7 @@ fi
set -e

if [ -e $input_dir/$package/apidiff.state ]; then
changes=$(apidiff $input_dir/$package/apidiff.state $package)
changes=$(${apidiff_cmd} $input_dir/$package/apidiff.state $package)
if [ ! -z "$changes" -a "$changes"!=" " ]; then
SUB='Incompatible changes:'
if [ $check_only = true ] && [[ "$changes" =~ .*"$SUB".* ]]; then
Expand Down
3 changes: 2 additions & 1 deletion internal/buildscripts/gen-apidiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ usage() {
dry_run=false
package=""
output_dir="./internal/data/apidiff"
apidiff_cmd="$(dirname $(realpath ${BASH_SOURCE:-$0}))/../../.tools/apidiff"


while getopts "dp:o:" o; do
Expand Down Expand Up @@ -55,7 +56,7 @@ trap clean_up EXIT

mkdir -p $tmp_dir/$package

apidiff -w $tmp_dir/$package/apidiff.state $package
${apidiff_cmd} -w $tmp_dir/$package/apidiff.state $package

# Copy files if not in dry-run mode.
if [ $dry_run = false ]; then
Expand Down

0 comments on commit 4f5412e

Please sign in to comment.