File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
8
8
9
9
## [ Unreleased]
10
10
11
+ ### Added
12
+
13
+ - Add registry link check to ` Makefile ` and pre-release script. (#446 )
14
+
11
15
## [ 0.15.0] - 2020-12-11
12
16
13
17
### Added
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
6
6
ALL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR ) , $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) )
7
7
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR ) ' | sort)
8
8
9
+ # URLs to check if all contrib entries exist in the registry.
10
+ REGISTRY_BASE_URL = https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/master/content/en/registry
11
+ CONTRIB_REPO_URL = https://github.com/open-telemetry/opentelemetry-go-contrib/tree/master
9
12
10
13
# Mac OS Catalina 10.5.x doesn't support 386. Hence skip 386 test
11
14
SKIP_386_TEST = false
@@ -159,6 +162,29 @@ license-check:
159
162
exit 1; \
160
163
fi
161
164
165
+ .PHONY : registry-links-check
166
+ registry-links-check :
167
+ @checkRes=$$( \
168
+ for f in $$ ( find ./instrumentation ./exporters ./detectors ! -path ' ./instrumentation/net/*' -type f -name ' go.mod' -exec dirname {} \; | egrep -v ' /example|/utils' | sort ) \
169
+ ./instrumentation/net/http; do \
170
+ TYPE=" instrumentation" ; \
171
+ if $$ (echo " $$ f" | grep -q " exporters" ); then \
172
+ TYPE=" exporter" ; \
173
+ fi ; \
174
+ if $$ (echo " $$ f" | grep -q " detectors" ); then \
175
+ TYPE=" detector" ; \
176
+ fi ; \
177
+ NAME=$$(echo "$$f" | sed -e 's/.*\///' -e 's/.*otel//' ) ; \
178
+ LINK=$(CONTRIB_REPO_URL ) /$$(echo "$$f" | sed -e 's/..//' -e 's/\/otel.*$$//' ) ; \
179
+ if ! $$ (curl -s $( REGISTRY_BASE_URL) /$$ {TYPE}-go-$$ {NAME}.md | grep -q " $$ {LINK}" ); then \
180
+ echo " $$ f" ; \
181
+ fi \
182
+ done ; \
183
+ ); \
184
+ if [ -n " $$ checkRes" ]; then \
185
+ echo " WARNING: registry link check failed for the following packages:" ; echo " $$ {checkRes}" ; \
186
+ fi
187
+
162
188
.PHONY : dependabot-check
163
189
dependabot-check :
164
190
@result=$$( \
Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ make lint
144
144
# Add changes and commit.
145
145
git add .
146
146
make ci
147
+ # Check whether registry links are up to date
148
+ make registry-links-check
149
+
147
150
declare COMMIT_MSG=" "
148
151
if [ -n " ${OTEL_TAG} " ]; then
149
152
COMMIT_MSG+=" Bumping otel version to ${OTEL_TAG} "
You can’t perform that action at this time.
0 commit comments