Skip to content

Commit 7dd0bee

Browse files
authored
Fix/docsrelease (#10389)
1 parent 25aa232 commit 7dd0bee

File tree

5 files changed

+54
-17
lines changed

5 files changed

+54
-17
lines changed

changelog/v1.18.0-rc2/docsgen.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog:
2+
- type: NON_USER_FACING
3+
description: >-
4+
Fix docs gen

docs/Makefile

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ MIN_SCANNED_VERSION ?= v1.13.0
2222
site-common: clean gloo-enterprise-version
2323
if [ ! -d themes/hugo-theme-soloio ]; then git clone https://github.com/solo-io/hugo-theme-soloio themes/hugo-theme-soloio; fi
2424
git -C themes/hugo-theme-soloio checkout $(SOLO_HUGO_THEME_REVISION)
25-
GO111MODULE=on go run cmd/generate_docs.go gen-releases -r gloo > opensource.out
26-
GO111MODULE=on go run cmd/generate_docs.go gen-releases -r glooe > enterprise.out
27-
GO111MODULE=on go run cmd/generate_docs.go gen-changelog-md -r gloo > content/static/content/gloo-changelog.docgen
28-
GO111MODULE=on go run cmd/generate_docs.go gen-changelog-md -r glooe > content/static/content/glooe-changelog.docgen
25+
go run cmd/generate_docs.go gen-releases -r gloo > opensource.out
26+
go run cmd/generate_docs.go gen-releases -r glooe > enterprise.out
27+
go run cmd/generate_docs.go gen-changelog-md -r gloo > content/static/content/gloo-changelog.docgen
28+
go run cmd/generate_docs.go gen-changelog-md -r glooe > content/static/content/glooe-changelog.docgen
2929

3030
# generate split security scans for gloo versions which HAVE received new split-templating updates
31-
MIN_SCANNED_VERSION=$(MIN_SCANNED_VERSION) GO111MODULE=on go run cmd/generate_docs.go gen-security-scan-md -r gloo > content/static/content/gloo-security-scan.docgen
32-
MIN_SCANNED_VERSION=$(MIN_SCANNED_VERSION) GO111MODULE=on go run cmd/generate_docs.go gen-security-scan-md -r glooe > content/static/content/glooe-security-scan.docgen
31+
MIN_SCANNED_VERSION=$(MIN_SCANNED_VERSION) go run cmd/generate_docs.go gen-security-scan-md -r gloo > content/static/content/gloo-security-scan.docgen
32+
MIN_SCANNED_VERSION=$(MIN_SCANNED_VERSION) go run cmd/generate_docs.go gen-security-scan-md -r glooe > content/static/content/glooe-security-scan.docgen
3333
cat content/static/content/gloo-security-scan.docgen
3434
./split-file-by-delimiter.sh content/static/content/gloo-security-scan.docgen \\\*\\\*\\\*
3535
./split-file-by-delimiter.sh content/static/content/glooe-security-scan.docgen \\\*\\\*\\\*
3636

3737
# get enterprise helm values based on contents of _output/gloo-enterprise-version
38-
GO111MODULE=on go run cmd/generate_docs.go get-enterprise-helm-values > content/static/content/glooe-values.docgen
38+
go run cmd/generate_docs.go get-enterprise-helm-values > content/static/content/glooe-values.docgen
3939
rm -f opensource.out enterprise.out
4040

4141

@@ -90,7 +90,7 @@ build-site: clean
9090
# corresponding to content in changelog directory.
9191
.PHONY: gloo-enterprise-version
9292
gloo-enterprise-version:
93-
cd .. && GO111MODULE=on go run hack/find_latest_enterprise_version/main.go
93+
cd .. && go run hack/find_latest_enterprise_version/main.go
9494

9595
#----------------------------------------------------------------------------------
9696
# Printing makefile variables utility

docs/cmd/generate_docs.go

+39-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
. "github.com/solo-io/gloo/docs/cmd/securityscanutils"
2424
changelogdocutils "github.com/solo-io/go-utils/changeloggenutils"
2525
"github.com/solo-io/go-utils/githubutils"
26+
"github.com/solo-io/go-utils/versionutils"
2627
"github.com/spf13/cobra"
2728
)
2829

@@ -193,6 +194,10 @@ const (
193194
repoOwner = "solo-io"
194195
glooOpenSourceRepo = "gloo"
195196
glooEnterpriseRepo = "solo-projects"
197+
198+
// donated names
199+
repoOwnerDonated = "k8sgateway"
200+
donatedOpenSourceRepo = "k8sgateway"
196201
)
197202

198203
const (
@@ -219,20 +224,46 @@ var (
219224
// Github defaults to a chronological order
220225
func generateChangelogMd(opts *options) error {
221226
client := githubutils.GetClientOrExit(context.Background())
227+
preNameChangeGatewayVersion := versionutils.NewVersion(1, 13, 0, "", 0)
222228
switch opts.targetRepo {
223229
case glooDocGen:
230+
224231
generator := changelogdocutils.NewMinorReleaseGroupedChangelogGenerator(changelogdocutils.Options{
225-
MainRepo: "gloo",
226-
RepoOwner: "solo-io",
232+
MainRepo: donatedOpenSourceRepo,
233+
RepoOwner: repoOwnerDonated,
234+
MaxVersion: preNameChangeGatewayVersion,
235+
MainRepoReleases: getCachedReleases(glooCachedReleasesFile),
236+
}, client)
237+
238+
out, err := generator.AddToOutput(context.Background())
239+
if err != nil {
240+
return err
241+
}
242+
243+
generator = changelogdocutils.NewMinorReleaseGroupedChangelogGenerator(changelogdocutils.Options{
244+
MainRepo: glooOpenSourceRepo,
245+
RepoOwner: repoOwner,
246+
MinVersion: preNameChangeGatewayVersion,
227247
MainRepoReleases: getCachedReleases(glooCachedReleasesFile),
228248
}, client)
229-
out, err := generator.GenerateJSON(context.Background())
249+
out2, err := generator.AddToOutput(context.Background())
230250
if err != nil {
231251
return err
232252
}
233-
fmt.Println(out)
253+
254+
err = out2.AddReleaseData(out)
255+
if err != nil {
256+
return err
257+
}
258+
259+
body, err := out2.GenerateJSON()
260+
if err != nil {
261+
return err
262+
}
263+
fmt.Println(body)
264+
234265
case glooEDocGen:
235-
err := generateGlooEChangelog()
266+
err := generateGlooEChangelog(preNameChangeGatewayVersion)
236267
if err != nil {
237268
return err
238269
}
@@ -244,7 +275,7 @@ func generateChangelogMd(opts *options) error {
244275
}
245276

246277
// Fetches Gloo Enterprise releases, merges in open source release notes, and orders them by version
247-
func generateGlooEChangelog() error {
278+
func generateGlooEChangelog(preNameVersion *versionutils.Version) error {
248279
// Initialize Auth
249280
ctx := context.Background()
250281
ghToken := os.Getenv("GITHUB_TOKEN")
@@ -259,6 +290,7 @@ func generateGlooEChangelog() error {
259290
NumVersions: 200,
260291
MainRepo: glooEnterpriseRepo,
261292
DependentRepo: glooOpenSourceRepo,
293+
MinVersion: preNameVersion,
262294
RepoOwner: repoOwner,
263295
MainRepoReleases: getCachedReleases(glooeCachedReleasesFile),
264296
DependentRepoReleases: getCachedReleases(glooCachedReleasesFile),
@@ -268,6 +300,7 @@ func generateGlooEChangelog() error {
268300
return err
269301
}
270302
generator := changelogdocutils.NewMergedReleaseGeneratorWithDepFn(opts, client, depFn)
303+
271304
out, err := generator.GenerateJSON(context.Background())
272305
if err != nil {
273306
return err

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/saiskee/gettercheck v0.0.0-20210820204958-38443d06ebe0
4949
github.com/sergi/go-diff v1.2.0
5050
github.com/solo-io/go-list-licenses v0.1.4
51-
github.com/solo-io/go-utils v0.27.1
51+
github.com/solo-io/go-utils v0.27.2
5252
github.com/solo-io/k8s-utils v0.8.1
5353
github.com/solo-io/protoc-gen-ext v0.0.25
5454
github.com/solo-io/protoc-gen-openapi v0.2.5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -2695,8 +2695,8 @@ github.com/solo-io/cue v0.4.7/go.mod h1:P1tN9y6nBPAMoEK5aJxI8kn0VUcjVcRc+8esieRz
26952695
github.com/solo-io/go-list-licenses v0.1.4 h1:u4xh1OUORT4iSWuAp3Q4NsfHcDaeUV8QRDH8ACQqbxw=
26962696
github.com/solo-io/go-list-licenses v0.1.4/go.mod h1:x6LSp/NrYgVXwNum7ZOiaAYTpg6B3F6TrWYfcdHVroA=
26972697
github.com/solo-io/go-utils v0.20.2/go.mod h1:6e8K1spnMWwlnJRSNp/J84GEyJbrcK4Gm7i+ehzCi8c=
2698-
github.com/solo-io/go-utils v0.27.1 h1:14XwaKv21EaYYeUF2wFfPe3DPz2Gbm9sfenGv/aRIls=
2699-
github.com/solo-io/go-utils v0.27.1/go.mod h1:cwbQIYO1/BeU4aPB0Yy8WzzS77dfVTZyCVqbA4YsRSY=
2698+
github.com/solo-io/go-utils v0.27.2 h1:4ixkKeOYsBVAL72mNUYfAUfqi5+ws3p6ztlKrG3A3Bg=
2699+
github.com/solo-io/go-utils v0.27.2/go.mod h1:cwbQIYO1/BeU4aPB0Yy8WzzS77dfVTZyCVqbA4YsRSY=
27002700
github.com/solo-io/k8s-utils v0.8.1 h1:Xqqze6RLWsHCYetbaiXDEnuhFRXyqw0azyogggK43H8=
27012701
github.com/solo-io/k8s-utils v0.8.1/go.mod h1:fOIFkh4+F45MmrUZEFx0pW75EvFYOR7v5/BIIQiSIwA=
27022702
github.com/solo-io/protoc-gen-ext v0.0.25 h1:UqNW/A4UqCO5aUFg7LYdV82tK0R2mqu7RFftYtT/Fu8=

0 commit comments

Comments
 (0)