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

remove cache-compiled-release command #464

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ jobs:
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
set -x
go test --run '(using_kiln|baking_a_tile|generating_release_notes|updating_)' \
-v --timeout 24h --tags acceptance \
github.com/pivotal-cf/kiln/internal/acceptance/workflows
go test -v --timeout 24h --tags acceptance github.com/pivotal-cf/kiln/internal/acceptance/workflows
git reset --hard HEAD
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,4 @@ jobs:
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
set -x
go test --run '(using_kiln|baking_a_tile|generating_release_notes|updating_)' \
-v --timeout 15m --tags acceptance \
github.com/pivotal-cf/kiln/internal/acceptance/workflows
go test -v --timeout 15m --tags acceptance github.com/pivotal-cf/kiln/internal/acceptance/workflows
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/aws/aws-sdk-go v1.44.325
github.com/blang/semver/v4 v4.0.0
github.com/cloudfoundry/bosh-cli v6.4.1+incompatible
github.com/cloudfoundry/bosh-utils v0.0.384
github.com/cppforlife/go-patch v0.2.0
github.com/crhntr/bijection v0.0.0-20230628013949-46b5c800bc70
github.com/crhntr/yamlutil v0.0.0-20230524174859-4e4388958875
Expand Down Expand Up @@ -50,13 +49,11 @@ require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/bmatcuk/doublestar v1.3.4 // indirect
github.com/charlievieth/fs v0.0.3 // indirect
github.com/cheggaaa/pb/v3 v3.1.4 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cloudfoundry-community/go-uaa v0.3.1 // indirect
github.com/cloudfoundry/bosh-utils v0.0.384 // indirect
github.com/cloudfoundry/go-socks5 v0.0.0-20180221174514-54f73bdb8a8e // indirect
github.com/cloudfoundry/socks5-proxy v0.2.96 // indirect
github.com/containerd/containerd v1.7.3 // indirect
Expand Down
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjA
github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
Expand Down Expand Up @@ -122,15 +120,12 @@ github.com/charlievieth/fs v0.0.3/go.mod h1:hD4sRzto1Hw8zCua76tNVKZxaeZZr1RiKftj
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
github.com/cheggaaa/pb v1.0.28/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/cheggaaa/pb/v3 v3.0.5/go.mod h1:X1L61/+36nz9bjIsrDU52qHKOQukUQe2Ge+YvGuquCw=
github.com/cheggaaa/pb/v3 v3.1.4 h1:DN8j4TVVdKu3WxVwcRKu0sG00IIU6FewoABZzXbRQeo=
github.com/cheggaaa/pb/v3 v3.1.4/go.mod h1:6wVjILNBaXMs8c21qRiaUM8BR82erfgau1DQ4iUXmSA=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudfoundry-community/go-uaa v0.3.1 h1:qmiTqE8Be3zJoL2wcwddVnbRNMDhOrURZbWOUQ2ibJQ=
github.com/cloudfoundry-community/go-uaa v0.3.1/go.mod h1:m3JOryy7cx+7QLxuwB+bXuAx5AUJ3W9XhRUBu6Eih0Q=
github.com/cloudfoundry/bosh-agent v2.340.0+incompatible/go.mod h1:7UvVn5vc/d6icLrBx6GhBlpSMwe2+x1C2A7x4TbPhiU=
github.com/cloudfoundry/bosh-cli v6.4.1+incompatible h1:n5/+NIF9QxvGINOrjh6DmO+GTen78MoCj5+LU9L8bR4=
Expand Down
37 changes: 0 additions & 37 deletions internal/acceptance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,6 @@ These are written in Go and use [godog](https://github.com/cucumber/godog) (a Cu
go test -v --tags acceptance --timeout=1h github.com/pivotal-cf/kiln/internal/acceptance/workflows
```

#### ⚠️ The `caching_compiled_releases` Test Does Not Run in CI ⚠️
This test requires SSH access to an Ops Manager.
Deploying an Ops Manager for an open source repo is not secure.
This one test should be run against a non-production Ops Manager or from a VMware developer's machine on the internal network using a Toolsmiths environment.

<details>
<summary><em>Instructions to test with a Toolsmiths deployed Ops Manager</em></summary>
<br>

Ensure you have the [Smith CLI](https://github.com/pivotal/smith) properly installed and you are logged in.

PPE team members may execute the AWS environment setup expressions in the script.
Non-ppe-team-members may ask us for temporary credentials [generated here](https://console.aws.amazon.com/iam/home#/users/kiln_acceptance_tests?section=security_credentials).
Note the credential created on 2022-08-08 (id ending in "QOV") should not be deleted. It is stored in vault.

```bash
## START Setup
eval "$(smith claim -p us_2_12)"
eval "$(smith bosh)"
eval "$(smith om)"
export OM_PRIVATE_KEY="$(cat $(echo "${BOSH_ALL_PROXY}" | awk -F= '{print $2}'))"

# AWS environment setup
export AWS_ACCESS_KEY_ID="$(vault read --field=aws_access_key_id runway_concourse/ppe-ci/kiln-acceptance-tests-s3)"
export AWS_SECRET_ACCESS_KEY="$(vault read --field=aws_secret_access_key runway_concourse/ppe-ci/kiln-acceptance-tests-s3)"

export GITHUB_TOKEN="$(gh auth status --show-token 2>&1 | grep Token | awk '{print $NF}')"

# optional
export CGO_ENABLED=0
## END Setup

# Run the caching_compiled_releases test
go test --run caching_compiled_releases -v --tags acceptance --timeout=1h github.com/pivotal-cf/kiln/internal/acceptance/workflows
```
</details>

## Contributing

Please follow existing style and make sure the acceptance unit tests both in the workflows and in the scenario package pass.
6 changes: 0 additions & 6 deletions internal/acceptance/workflows/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ func Test_baking_a_tile(t *testing.T) {
setupAndRunFeatureTest(t)
}

func Test_caching_compiled_releases(t *testing.T) {
setupAndRunFeatureTest(t,
scenario.InitializeCacheCompiledReleases,
)
}

func Test_generating_release_notes(t *testing.T) {
setupAndRunFeatureTest(t, scenario.InitializeGitHub)
}
Expand Down
35 changes: 0 additions & 35 deletions internal/acceptance/workflows/caching_compiled_releases.feature

This file was deleted.

51 changes: 0 additions & 51 deletions internal/acceptance/workflows/scenario/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,6 @@ func initializeAWS(ctx scenarioContext) {
ctx.Step(regexp.MustCompile(`^I remove all the objects in the bucket "([^"]+)"$`), iRemoveAllTheObjectsInBucket)
}

// InitializeCacheCompiledReleases requires environment configuration to interact with a Tanzu Ops Manager.
//
// # Environment
//
// - AWS_ACCESS_KEY_ID: credentials with access to an empty S3 bucket where the release will be cached
// - AWS_SECRET_ACCESS_KEY: credentials with access to empty an S3 bucket where the release will be cached
// - BOSH_ALL_PROXY: this environment variable is required by the BOSH client used in Kiln. To see how to construct it see [BOSH CLI Tunneling]: https://bosh.io/docs/cli-tunnel/
// - OM_TARGET: should be set to a url like https://pcf.example.com
// - OM_USERNAME: should be set to the Ops Manager username
// - OM_PASSWORD: should be set to the Ops Manager password
// - OM_PRIVATE_KEY: should be set with a private key in PEM format that can be used to ssh to the ops manager
//
// ## Debugging
//
// The AWS credentials are the default environment variables for the AWS CLI.
// Note you can change the bucket used for testing by changing the value in the feature file.
// So you can check if they will work by invoking the following command:
//
// aws s3 ls s3://hello-tile-releases
//
// The OM_TARGET, OM_USERNAME, and OM_PASSWORD behave as they would with the OM CLI.
// You can ensure they are correct by running any om command. For example:
//
// om staged-products
//
// Note, where the scenario uses the om CLI, the command inherits the parent's environment.
// So if needed you can set OM_SKIP_SSL_VALIDATION and other om environment variables.
//
// OM_PRIVATE_KEY is not a standard om environment variable; it is used by kiln not OM.
// To ensure it works you can execute:
//
// echo "${OM_PRIVATE_KEY}" > /tmp/om.key
// chmod 0400 /tmp/om.key
// ssh -i /tmp/om.key "[email protected]"
func InitializeCacheCompiledReleases(ctx *godog.ScenarioContext) {
initializeCacheCompiledReleases(ctx)
}

func initializeCacheCompiledReleases(ctx scenarioContext) {
ctx.Before(func(ctx context.Context, sc *godog.Scenario) (context.Context, error) {
_, _, err := loadS3Credentials()
if err != nil {
return ctx, err
}
return loadEnvironment(ctx)
})
ctx.Step(regexp.MustCompile(`^I add a compiled s3 release-source "([^"]*)" to the Kilnfile$`), iAddACompiledSReleaseSourceToTheKilnfile)
ctx.Step(regexp.MustCompile(`^I set the stemcell version in the lock to match the one used for the tile$`), iSetTheStemcellVersionInTheLockToMatchTheOneUsedForTheTile)
ctx.Step(regexp.MustCompile(`^I upload, configure, and apply the tile$`), iUploadConfigureAndApplyTheTile)
}

func InitializeEnv(ctx *godog.ScenarioContext) { initializeEnv(ctx) }
func initializeEnv(ctx scenarioContext) {
ctx.Step(regexp.MustCompile(`^the environment variable "([^"]+)" is set$`), theEnvironmentVariableIsSet)
Expand Down
3 changes: 0 additions & 3 deletions internal/acceptance/workflows/scenario/initialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ func TestInitialize(t *testing.T) {
t.Run("AWS", func(t *testing.T) {
initializeAWS(newFakeScenarioContext(t))
})
t.Run("CacheCompiledReleases", func(t *testing.T) {
initializeCacheCompiledReleases(newFakeScenarioContext(t))
})
t.Run("Env", func(t *testing.T) {
initializeEnv(newFakeScenarioContext(t))
})
Expand Down
129 changes: 0 additions & 129 deletions internal/acceptance/workflows/scenario/ops_manager_environment.go

This file was deleted.

This file was deleted.

Loading
Loading