Fixes opentofu/opentofu#1131: Statically generated releases page (#25)

* Fixes opentofu/opentofu#1131: Statically generated releases page

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Workflow

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Fixed workflow

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Fixing cloudflare build

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Fixing file layout for cf

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Pedantic: line endings

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Removed dist folder

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Fixed gitignore

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Fixed test directories

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

* Hopefully the last reorg fixes

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>

---------

Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
This commit is contained in:
Janos 2024-05-17 16:49:29 +02:00 committed by GitHub
parent 16532ba1a6
commit 17215be18f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 504 additions and 66 deletions

View file

@ -2,6 +2,32 @@ name: Test
on:
pull_request:
jobs:
releases:
name: Releases page
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run tests
working-directory: releases-generator
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Upload test log
uses: actions/upload-artifact@v2
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
@ -13,7 +39,7 @@ jobs:
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Run shellcheck
working-directory: src
working-directory: static
run: shellcheck -o all install-opentofu.sh
linux:
name: Linux

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.wrangler
node_modules
.idea
dist

6
build.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
cp -rf ./static ./dist
go run releases-generator/cmd/main.go dist/tofu/

View file

@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "nodenext",
"lib": ["esnext"],
"types": ["@cloudflare/workers-types"]
}
}
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "nodenext",
"lib": ["esnext"],
"types": ["@cloudflare/workers-types"]
}
}

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module github.com/opentofu/get.opentofu.org
go 1.21

57
releases-generator/api.go Normal file
View file

@ -0,0 +1,57 @@
package releases_generator
import (
_ "embed"
"encoding/json"
"fmt"
"github.com/opentofu/get.opentofu.org/releases-generator/github"
)
//go:embed index.gohtml
var indexTemplate []byte
//go:embed release.gohtml
var releaseTemplate []byte
// New creates a new Generator using a provider GitHub client.
func New(
githubClient github.Client,
) (Generator, error) {
return &generator{
githubClient,
}, nil
}
// Generator provides a method to generate all files for the releases page.
type Generator interface {
Generate() (map[string][]byte, error)
}
type generator struct {
github github.Client
}
func (g *generator) Generate() (map[string][]byte, error) {
result := make(map[string][]byte)
releases, err := g.github.GetReleases()
if err != nil {
return nil, fmt.Errorf("failed to fetch GitHub releases: %w", err)
}
index := githubResponseToIndex(releases)
result["api.json"], err = json.Marshal(index)
if err != nil {
return nil, fmt.Errorf("failed to marshal releases API file: %w", err)
}
result["index.html"], err = renderTemplate(indexTemplate, index)
for _, version := range index.Versions {
result[version.ID+"/index.html"], err = renderTemplate(releaseTemplate, version)
if err != nil {
return nil, fmt.Errorf("failed to render release template for version %s: %w", version.ID, err)
}
}
return result, nil
}

View file

@ -0,0 +1,93 @@
package releases_generator_test
import (
"encoding/json"
"strings"
"testing"
releases_generator "github.com/opentofu/get.opentofu.org/releases-generator"
"github.com/opentofu/get.opentofu.org/releases-generator/github"
)
func TestGenerator_Generate(t *testing.T) {
releases := github.ReleasesResponse{
{
TagName: "v1.0.0",
Assets: []github.Asset{
{
Name: "tofu_v1.0.0.tar.gz",
},
},
},
}
gh, err := github.NewFake(releases)
if err != nil {
t.Fatal(err)
}
generator, err := releases_generator.New(gh)
if err != nil {
t.Fatal(err)
}
result, err := generator.Generate()
if err != nil {
t.Fatal(err)
}
t.Run("api", func(t *testing.T) {
api, ok := result["api.json"]
if !ok {
t.Fatal("api.json not found.")
}
var apiData map[string]interface{}
if err := json.Unmarshal(api, &apiData); err != nil {
t.Fatal(err)
}
versions, ok := apiData["versions"]
if !ok {
t.Fatal("Versions key not found.")
}
if l := len(versions.([]interface{})); l != 1 {
t.Fatalf("Incorrect number of versions found: %d", l)
}
version := versions.([]interface{})[0].(map[string]interface{})
if version["id"] != "1.0.0" {
t.Fatalf("Incorrect version id: %s", version["id"])
}
if l := len(version["files"].([]interface{})); l != 1 {
t.Fatalf("Incorrect number of files: %d", l)
}
if fn := version["files"].([]interface{})[0]; fn != "tofu_v1.0.0.tar.gz" {
t.Fatalf("Incorrect file name: %s", fn)
}
})
t.Run("index", func(t *testing.T) {
index, ok := result["index.html"]
if !ok {
t.Fatal("index.html not found")
}
if !strings.Contains(string(index), `<a href="/tofu/1.0.0/">tofu_1.0.0</a>`) {
t.Fatal("Expected version link not found.")
}
})
t.Run("version", func(t *testing.T) {
version, ok := result["1.0.0/index.html"]
if !ok {
t.Fatal("1.0.0/index.html not found")
}
if !strings.Contains(
string(version),
`<a href="https://github.com/opentofu/opentofu/releases/download/v1.0.0/tofu_v1.0.0.tar.gz">tofu_v1.0.0.tar.gz</a>`,
) {
t.Fatal("Expected file link not found.")
}
})
}

View file

@ -0,0 +1,49 @@
package main
import (
"fmt"
"log"
"os"
"path"
releasesGenerator "github.com/opentofu/get.opentofu.org/releases-generator"
"github.com/opentofu/get.opentofu.org/releases-generator/github"
)
func main() {
if len(os.Args) != 2 {
fmt.Printf("Usage: %s target-dir/\n", os.Args[0])
os.Exit(1)
}
targetDir := os.Args[1]
if err := os.MkdirAll(targetDir, 0755); err != nil {
log.Fatalf("Could not create target directory: %v", err)
}
gh, err := github.New(os.Getenv("GITHUB_TOKEN"))
if err != nil {
log.Fatal(err)
}
generator, err := releasesGenerator.New(gh)
if err != nil {
log.Fatal(err)
}
files, err := generator.Generate()
if err != nil {
log.Fatal(err)
}
for file, contents := range files {
targetFile := path.Join(targetDir, file)
fileDir := path.Dir(targetFile)
if err := os.MkdirAll(fileDir, 0755); err != nil {
log.Fatalf("Could not create directory for file %s: %v", targetFile, err)
}
if err := os.WriteFile(targetFile, contents, 0644); err != nil {
log.Fatalf("Could not write file %s: %v", targetFile, err)
}
}
}

View file

@ -0,0 +1,40 @@
package releases_generator
import (
"strings"
"github.com/opentofu/get.opentofu.org/releases-generator/github"
)
// Index holds all data for all versions.
type Index struct {
Versions []Version `json:"versions"`
}
// Version holds the file list for a single version.
type Version struct {
ID string `json:"id"`
Files []string `json:"files"`
}
func githubResponseToIndex(response github.ReleasesResponse) *Index {
if response == nil {
return &Index{Versions: nil}
}
result := &Index{
Versions: make([]Version, len(response)),
}
for i, release := range response {
result.Versions[i] = Version{
ID: strings.TrimLeft(release.TagName, "v"),
Files: func() []string {
files := make([]string, len(release.Assets))
for i, asset := range release.Assets {
files[i] = asset.Name
}
return files
}(),
}
}
return result
}

View file

@ -0,0 +1,22 @@
package github
import (
"fmt"
)
func NewFake(releases ReleasesResponse) (Client, error) {
return &fakeGitHub{
releases,
}, nil
}
type fakeGitHub struct {
releases ReleasesResponse
}
func (f fakeGitHub) GetReleases() (ReleasesResponse, error) {
if f.releases == nil {
return nil, fmt.Errorf("no releases provided, returning error for simulation")
}
return f.releases, nil
}

View file

@ -0,0 +1,87 @@
package github
import (
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
)
// ReleasesResponse contains all releases fetched from GitHub.
type ReleasesResponse []Release
// Release describes a single release on GitHub.
type Release struct {
TagName string `json:"tag_name"`
Assets []Asset `json:"assets"`
}
// Asset describes a single asset.
type Asset struct {
Name string `json:"name"`
}
// Client describes the functions needed for this tool to work.
type Client interface {
// GetReleases fetches all releases from GitHub.
GetReleases() (ReleasesResponse, error)
}
// New creates a new Client with the specified token. If no token is specified, the client will attempt to proceed
// without one.
func New(token string) (Client, error) {
transport := http.DefaultTransport.(*http.Transport)
// Based on the Mozilla "modern" compatibility, see
// https://wiki.mozilla.org/Security/Server_Side_TLS
transport.TLSClientConfig = &tls.Config{
CipherSuites: []uint16{
tls.TLS_AES_128_GCM_SHA256,
tls.TLS_AES_256_GCM_SHA384,
tls.TLS_CHACHA20_POLY1305_SHA256,
},
MinVersion: tls.VersionTLS13,
CurvePreferences: []tls.CurveID{
tls.X25519, tls.CurveP256, tls.CurveP384,
},
}
return &client{
token: token,
client: &http.Client{
Transport: http.DefaultTransport,
},
}, nil
}
type client struct {
token string
client *http.Client
}
func (c client) GetReleases() (ReleasesResponse, error) {
req, err := http.NewRequest(
"GET",
"https://api.github.com/repos/opentofu/opentofu/releases",
nil,
)
if err != nil {
return nil, fmt.Errorf("failed to create HTTP request: %w", err)
}
if c.token != "" {
req.Header.Set("Authorization", "token "+c.token)
}
resp, err := c.client.Do(req)
if err != nil {
return nil, fmt.Errorf("failed to query the GitHub API: %w", err)
}
defer resp.Body.Close()
var responseData ReleasesResponse
if err := json.NewDecoder(resp.Body).Decode(&responseData); err != nil {
return nil, fmt.Errorf("failed to decode GitHub releases response: %w", err)
}
return responseData, nil
}

View file

@ -0,0 +1,14 @@
{{- /*gotype: github.com/opentofu/get.opentofu.org/releases_generator.Index*/ -}}
<!DOCTYPE html>
<html>
<head>
<title>OpenTofu releases</title>
</head>
<body>
<ul>
{{- range .Versions -}}
<li><a href="/tofu/{{ .ID }}/">tofu_{{ .ID }}</a></li>
{{- end -}}
</ul>
</body>
</html>

View file

@ -0,0 +1,20 @@
{{- /*gotype: github.com/opentofu/get.opentofu.org/releases_generator.Version*/ -}}
<!DOCTYPE html>
<html>
<head>
<title>OpenTofu {{ .ID }}</title>
</head>
<body>
<ul>
<li>
<a href="/tofu/">../</a>
</li>
{{- $id := .ID}}
{{- range .Files }}
<li>
<a href="https://github.com/opentofu/opentofu/releases/download/v{{- $id -}}/{{- . -}}">{{- . -}}</a>
</li>
{{- end -}}
</ul>
</body>
</html>

View file

@ -0,0 +1,20 @@
package releases_generator
import (
"bytes"
"fmt"
"html/template"
)
func renderTemplate(templateData []byte, data any) ([]byte, error) {
tpl := template.New("")
tpl, err := tpl.Parse(string(templateData))
if err != nil {
return nil, fmt.Errorf("failed to parse template: %w", err)
}
var result bytes.Buffer
if err := tpl.Execute(&result, data); err != nil {
return nil, fmt.Errorf("failed to execute template: %w", err)
}
return result.Bytes(), nil
}

View file

@ -1,52 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
xsFNBGVUyIwBEADPg6jUJm5liMTiDndyprnwXQ23GdyQm/kW9MFOhYDRksmmbsz0
DCfqntFpuoKxPXzA+JTrZlWZONtU+leZjIOlAVZiz0rwz5EJq7uIrkueWtUk6AYk
BLN+zMtbui0z3HCPVNnR5BlVNyXQeW3jlrQtzuKevjZWzI0gbQGgEKNpj+lfyRFu
6q3u/T0o3p/6bOOlQHwCMtnFlWpjr6f/J2EdUVO/6NYHQzImPj4LINXF/+eqo7v6
svFtaVTtREG2V2V7We7bu/cJ+NgJYH7ro7UhB1RQH2k09NdpSCt9F60PVERnORpx
GBkM/VKZzgMSzRvdpxUWwrLxfAxinu5ddbBm3y0bzaU80OT3i1qrWIqW73fmdGHQ
71gbJxRrroyLMWehjcJ/9WJDxkHqsfPKqBifYsp6/J9npczDfSU+zYBVGpR73a4E
dbeIRWqwbH0LWhlbi1IM5aFDaZMFNkY+AWyP+OHn8Kehu6DOIh1AVM7v7vLxaX9h
t1jVJbswjvPFYquv1DvUdc7VP2QHz3xctQS1GZJQ1ekcgT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FniaYv2PdqH8HDjvXZXqHypRMXvYMbXXOgydLL+tSUSBpMTd4afjq8x2gNSWOEL
I1jT5FWbKTKan0ycKi37bSqGHhDjlg4HRGvC3IK0EuVjdX3r+8uIVgFbqLwNhXk4
GAIL03vl689TQ7/oPW75XCQIevFai0kcJPl6qIRvi9/S/v5EPRy9UDCGY/MPmc5f
H1an0ebU4I4TlYfBoEUkYYqBDxvxWW0I/Q01rDebcd6mrGw8lW1EiNZlClLwx9Bv
/+MNnIT9m1f8KeqmweoAgbIQRUI7EkJSzxYN4DNuy2XoKmF9
=VhyH
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -1,6 +1,6 @@
#!/bin/sh
set -ex
"${SHELL_COMMAND}" /src/install-opentofu.sh --debug --install-method "${METHOD_NAME}"
"${SHELL_COMMAND}" /static/install-opentofu.sh --debug --install-method "${METHOD_NAME}"
tofu --version

View file

@ -46,7 +46,7 @@ if [ -n "${DOCKER_INIT}" ]; then
fi
CID=$(\
docker create -tq \
-v "$(realpath "$(pwd)/../../src"):/src" \
-v "$(realpath "$(pwd)/../../static"):/static" \
-v "$(realpath "$(pwd)/../"):/tests" \
-e "DISTRO=${DISTRO}" \
-e "METHOD=${METHOD}" \

View file

@ -2,6 +2,6 @@
set -ex
../../src/install-opentofu.sh --debug --install-method "brew"
../../static/install-opentofu.sh --debug --install-method "brew"
tofu --version

View file

@ -2,6 +2,6 @@
set -ex
../../src/install-opentofu.sh --debug --install-method "standalone"
../../static/install-opentofu.sh --debug --install-method "standalone"
tofu --version

View file

@ -19,6 +19,6 @@ $PSDefaultParameterValues['*:ErrorAction']='Stop'
& ".\in-sandbox\methods\${method}.ps1"
& '..\..\src\install-opentofu.ps1' -installMethod "${method}"
& '..\..\static\install-opentofu.ps1' -installMethod "${method}"
tofu --version