Skip to content

Commit

Permalink
Merge the work from anynines back to the community (#1)
Browse files Browse the repository at this point in the history
* Make builds work and abstract away architecture (#1)

* use centos 7 as default base image

* don't remove packages that aren't there

* set imagePullPolicy to IfNotPresent

* adjust docker org and tag

* make builds work with centos 7, also revise build script to include param for architecture

* adjust image list for centos 7

* Improvements in vulnerability checking (#8)

* Fix install of swag

Go now uses `go install` instead of `go get` to install packages to the local machine

* replace docs module appropriately

* Configure dependabot

Introduce a basic dependabot.yaml to check for
updates both in the project root for npm and in
the backend directory (src/jetstream) for go

* Include website and electron projects in dependabot

* Fix the CVEs in the jetstream backend (#12)

* Delete grufty go.sum, gut go.mod entirely and refresh dependencies

* add back some dependencies needed for tests to run; update return values of methods using go-sqlmock to use pointers

* Fix backend unit tests (also code quality improvements) (#15)

* Fix backend unit tests

- Ensure int value is formatted as such
- This was causing the backend unit tests to fail, possibly by dependency change

* Replace ioutil usage and decapitalize error strings

* Change receiver to be a pointer in order for assignment to persist

If the receiver is not pointer, the struct is copied and the assignment `r.sent = true` has no effect because r will be discarded after the function returns.

---------

Co-authored-by: Richard Cox <[email protected]>

* Theme Builder: Cast types (#16)

In this case, `prjMetadata.root` is an untyped JSON result (that is, it
can be object, array, number, etc.), but FS.copySync needs to take a
string; do an explicit cast here to make TypeScript happy.

Signed-off-by: Mark Yen <[email protected]>
Co-authored-by: Mark Yen <[email protected]>

* Update required disk space (#17)

Co-authored-by: Neil MacDougall <[email protected]>

* Migrate to github.com/pressly/goose (#18)

* Migrate to goose fork

* Code quality improvements from go-staticcheck

* Migrate migrations to github.com/pressly/goose

---------

Co-authored-by: Ivan Kapelyukhin <[email protected]>

* Move repository/interfaces to its own submodule: api (#19)

* Delete grufty go.sum, gut go.mod entirely and refresh dependencies

* add back some dependencies needed for tests to run; update return values of methods using go-sqlmock to use pointers

* Update module structure

* Small update of functions/imports to get latest version

* Adjust to pointers for newer version of sqlmock

* Remove ioutil, add new logic to actually get expiry claim from jwt

* Move api into its own module

* change all dependent code besides mock implementaions

* Change mock implementations manually as no gomock command is documented

* Moved and regenerated mock implementations

This was donw with the commands
`mockgen -source=api/auth.go > api/mock/mock_auth.go
as well as
`mockgen -source=repository/apikeys/apikeys.go > repository/apikeys/mock/mock_apikeys.go`
after installing https://github.com/golang/mock with `go install github.com/golang/mock/[email protected]`. This tool however is archived and should be replaced with a fork.

* Build and push base images on push to develop (#11)

* Add action to build base images/push to ghcr.io

* Upgrade go to 1.20.7

* set all docker related env variables to anynines/ghcr.io/centos7

* Add Helm support for local repos in desktop mode (#14)

* Add Helm support for local repos in desktop mode

* Join errors instead of returning just the second error

* Implement all methods required by interface

* Properly quote struct tags

* Bubble up errors, don't just drop them

* no longer use deprecated ioutil package, replace with os and  io

* Don't capitalize error messages

* Remove formatting directives from string, parameters should be appended instead

* Fix the CVEs in the jetstream backend (#12)

* Delete grufty go.sum, gut go.mod entirely and refresh dependencies

* add back some dependencies needed for tests to run; update return values of methods using go-sqlmock to use pointers

* Fix backend unit tests (also code quality improvements) (#15)

* Fix backend unit tests

- Ensure int value is formatted as such
- This was causing the backend unit tests to fail, possibly by dependency change

* Replace ioutil usage and decapitalize error strings

* Change receiver to be a pointer in order for assignment to persist

If the receiver is not pointer, the struct is copied and the assignment `r.sent = true` has no effect because r will be discarded after the function returns.

---------

Co-authored-by: Richard Cox <[email protected]>

* Theme Builder: Cast types (#16)

In this case, `prjMetadata.root` is an untyped JSON result (that is, it
can be object, array, number, etc.), but FS.copySync needs to take a
string; do an explicit cast here to make TypeScript happy.

Signed-off-by: Mark Yen <[email protected]>
Co-authored-by: Mark Yen <[email protected]>

* Update required disk space (#17)

Co-authored-by: Neil MacDougall <[email protected]>

* Migrate to github.com/pressly/goose (#18)

* Migrate to goose fork

* Code quality improvements from go-staticcheck

* Migrate migrations to github.com/pressly/goose

---------

Co-authored-by: Ivan Kapelyukhin <[email protected]>

* Move repository/interfaces to its own submodule: api (#19)

* Delete grufty go.sum, gut go.mod entirely and refresh dependencies

* add back some dependencies needed for tests to run; update return values of methods using go-sqlmock to use pointers

* Update module structure

* Small update of functions/imports to get latest version

* Adjust to pointers for newer version of sqlmock

* Remove ioutil, add new logic to actually get expiry claim from jwt

* Move api into its own module

* change all dependent code besides mock implementaions

* Change mock implementations manually as no gomock command is documented

* Moved and regenerated mock implementations

This was donw with the commands
`mockgen -source=api/auth.go > api/mock/mock_auth.go
as well as
`mockgen -source=repository/apikeys/apikeys.go > repository/apikeys/mock/mock_apikeys.go`
after installing https://github.com/golang/mock with `go install github.com/golang/mock/[email protected]`. This tool however is archived and should be replaced with a fork.

* Build and push base images on push to develop (#11)

* Add action to build base images/push to ghcr.io

* Upgrade go to 1.20.7

* set all docker related env variables to anynines/ghcr.io/centos7

* Add Helm support for local repos in desktop mode

* Add github.com/pressly/goose

---------

Signed-off-by: Mark Yen <[email protected]>
Co-authored-by: Neil MacDougall <[email protected]>
Co-authored-by: Richard Cox <[email protected]>
Co-authored-by: Mark Yen <[email protected]>
Co-authored-by: Neil MacDougall <[email protected]>
Co-authored-by: Ivan Kapelyukhin <[email protected]>

* Fix dependency for database migrations (#20)

* Add github.com/pressly/goose

* Tidy up go.mod and go.sum

* Adapt cloudfoundry/stratos#4580: Update store references in core package to refer to @stratosui/store (#26)

* Adapt cloudfoundry/stratos#4580

All references to the core package have been
changed to refer to @stratosui/store.
Some unnecessary newlines have been removed.
The public API of @stratosui/store has been
adjusted as to expose all the necessary functions.

---------

Co-authored-by: Matthias Folz <[email protected]>

* Fix database migrations by casting dialect correctly (#22)

* Remove unnecessary ignored return value

* change cast of dialect to pointer casts, so that they actually work

* add Github Actions for Backend and Frontend Tests (#29)

* add Github Actions for Backend and Frontend Tests
* revert recently package-lock.json

* Add script to help with building as packages and fix devkit and package info

* Apply changes from cloudfoundry/stratos#4529 (#28)

* Fix typo (#31)

* Code quality improvements via `staticcheck` (#24)

* Fix error messages

They shouldn't end with punctuation or newlines and should not be capitalized

* Merge variable declarations and assignments if they are on subsequent lines

* General improvements according to staticcheck

* Change expected error messages in tests

* Tidy up go.mod/go.sum

* Change error message texts in response bodies

* tidy up github action workflow for backend tests to resolve wrong golang version during tests (#32)

* Update to node v20 (#34)

* Update to node v18

* Update to node v20

* Remove sass-lint and stratos-protractor-reporter (#37)

These not very necessary dependencies caused transitive deps to minimist and underscore in versions with CVEs.

* Apply changes from cloudfoundry/stratos#4583 (#33)

* Upgrade code.cloudfoundry.org/cli to v8 (#42)

* fix dependency issues to compile binary for CF

* update go.mod/sum for jetstream

* crteate extra_plugins.go also for backend tests

* update kubernetes dependencies

* Upgrade code.cloudfoundry.org/cli to 8.7.3; Remove push_actor wrapper since it is redundant; fix loggregator/logcache protobuf conflicts

Co-authored-by: Matthias Folz <[email protected]>

---------

Co-authored-by: Matthias Folz <[email protected]>
Co-authored-by: Matthias Folz <[email protected]>

* Cherry pick commit 69ac7dc from other branch; now works without any restrictions; original commit message: (#45)

Apply patch from freudl/stratos#1 manually

This results in a version that works, but only
when run with GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn
or compiled with -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn"

This has to be adressed with an update to the
cf dependencies to at least version 9

* fix gogoproto related panic when retrieving logs upgrade github.com/cloudfoundry/noaa/consumer to 2.3.0 (#46)

* Fix frontend CVEs (#40)

* Update @angular/core via ng update to 11.2.14

* Upgrade @angular/cdk to 11.2.14

* Update @angular/cli to 11.2.14

* Update @angular/material to 11.2.14

* Update @ngrx/store to v11

* WIP: fix peer dependencies for angular 11

This commit does NOT compile, likely due to an error with the angular compiler and mismatched version. The next commit will upgrade all deps to angular 12 to remedy this.

* Update @angular/core to v12

* Update @angular/cdk to v12

* Update @angular/material and @angular/flex-layout to v12, also @ngrx/store

* Update @angular/cli to v12

* Update @angular-builders/custom-webpack to v12, replace @cfstratos/ajsf-material with original @ajsf/material

* change custom SassHandler to handle new WebPack 5 Structure as well

* Fix KnownKeys type issues for updated [email protected]

* Remove debug logging

* Remove overrides for angular upgrade

* Upgrade to angular v13

* Upgrade to angular v14

* Remove references to @cfstratos/ajsf-material

* Move code coverage to different tests

* WIP: Fix tests, still a lot of warnings

* discontinue use of karma-coverage-instanbul-reporter

* Use @cypress/request where possible

* Upgrade immer

* Upgrade @types/karma

* Update marked; change imports accordingly

* Update immer; fix typing for api-request-reducers

* update @swimlane/ngx-charts; fix type issues

* Replace request with maintained fork

* Add npm as engine requirement to make sure overrides work

* Fix up lockfile

* Formatting

---------

Co-authored-by: Matthias Folz <[email protected]>
Co-authored-by: Tim Meier <[email protected]>

* feat: add errorz package to combine errors as enum in there (#47)

* feat: add errorz package to combine errors as enum in there

* feat: missed duplicated error

* fix: not worked error checks

* fix: not worked error checks

* rename error package

* applied JRA's suggestions

* applied JRA's suggestions

* fix error in test suite

---------

Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: Jan-Robin Aumann <[email protected]>

* allow newer pgsql versions (#51)

* feat: support for PostgreSQL 15

* feat: psql 15 integration

---------

Co-authored-by: Nedim Akar <[email protected]>

* Bump @babel/traverse from 7.23.0 to 7.23.6 (#83)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.23.0 to 7.23.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.6/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @adobe/css-tools from 4.3.1 to 4.3.2 (#77)

Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release 4.5.1 (#130)

* allow newer pgsql versions (#51)

* feat: support for PostgreSQL 15

* feat: psql 15 integration

---------

Co-authored-by: Nedim Akar <[email protected]>

* Allow product name to be changed (#25)

Co-authored-by: Neil MacDougall <[email protected]>

* Initial support for CA Certificates for endpoints (#21)

* Adapt "Initial support for CA Certificates for endpoints"

* Add frontend changes for ca-certs

* use correct attribute

* fix pgsql tests by adding empty string for ca_cert

* fix tests by adding the new columns "enabled" (tokens) and "cacert" (cnsis) in various locations for the test suite

* implement requested changes

* fix typo

* update dependencies to address cves (#88)

* upgrade golang/x/net to fix CVE-2023-39325

* address https://github.com/anynines/stratos/security/dependabot/170

* Address https://github.com/anynines/stratos/security/dependabot/323

* Address https://github.com/anynines/stratos/security/dependabot/321

* run go mod tidy

* run go mod tidy

* Upgrade archiver for https://github.com/anynines/stratos/security/dependabot/320

* Upgrade archiver in main go.mod

* Update golang/x libs everywhere, tidy up plugins/monocular module file

* upgrade grpc again

* Bump word-wrap from 1.2.3 to 1.2.4 in /electron (#9)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump debug in /website (#41)

Bumps  and [debug](https://github.com/debug-js/debug). These dependencies needed to be updated together.

Updates `debug` from 4.1.1 to 4.3.4
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](debug-js/debug@4.1.1...4.3.4)

Updates `debug` from 3.2.6 to 4.3.4
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](debug-js/debug@4.1.1...4.3.4)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: indirect
- dependency-name: debug
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Deduplicate column names in tests (#75)

* add samber/lo

* add helper functions to datastore to centralize column name management

* add test helper funtions to generate mock rows and predefined entities

* switch tests over to helper functions

* cover oauth tests as much as possible

* add some more missing row addons

* Fix columns

* Switch CNSI tests over to actual cnsi records; also add expired tokens left out during first refactor

* fix column name without underscore

* Remove legacy GO111MODULE flag and update swag binary (#106)

* Remove legacy GO111MODULE flag and update swag binary

* Add fix for type resolution

* INT-3729 - Stratos - Website: Update Docusaurus to nearest stable (#111)

* Working 2.0.1 🎉

* Fix broken links

* fix small mistake with sed

* fix sed expression

* fix indent

* upgrade docusaurus to 2.4.3 (#112)

* Upgrade to docusaurus v3 (#119)

* Add 'all versions' to drop down

* Upgrade versions to docusaurus v3

* Make the theme switcher button white

* Properly escape the hint on commit signing

* Add workarounds for v3 upgrade

* fix indent

* Add context on why workaround is necessary

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: Matthias Folz <[email protected]>
Co-authored-by: Neil MacDougall <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update container-push-base-images-develop.yaml (#135)

Change the secrets to properly work with github package registry

---------

Signed-off-by: Mark Yen <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Richard Cox <[email protected]>
Co-authored-by: Mark Yen <[email protected]>
Co-authored-by: Neil MacDougall <[email protected]>
Co-authored-by: Ivan Kapelyukhin <[email protected]>
Co-authored-by: Neil MacDougall <[email protected]>
Co-authored-by: Matthias Folz <[email protected]>
Co-authored-by: Matthias Folz <[email protected]>
Co-authored-by: Tim Meier <[email protected]>
Co-authored-by: Tim Meier <[email protected]>
Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: Nedim Akar <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
14 people authored Mar 13, 2024
1 parent 9869ad6 commit 1172e4e
Show file tree
Hide file tree
Showing 1,075 changed files with 49,408 additions and 38,350 deletions.
25 changes: 25 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---

version: 2

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "npm"
directory: "/electron"
schedule:
interval: "daily"

- package-ecosystem: "npm"
directory: "/website"
schedule:
interval: "daily"

- package-ecosystem: "gomod"
directory: "src/jetstream/"
schedule:
interval: "daily"

35 changes: 35 additions & 0 deletions .github/workflows/backend_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Backend Tests

on:
push:
branches:
- develop
- master
pull_request:

jobs:
test_suite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.0'
cache-dependency-path: |
src/jetstream/go.sum
- name: Create extra_plugins.go
run: |
echo 'package main
// This file is auto-generated - DO NOT EDIT
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/autoscaler"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/cloudfoundry"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/cfapppush"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/cfappssh"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/userinvite"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/analysis"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/kubernetes"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/monocular"' > src/jetstream/extra_plugins.go
- name: Run tests
run: build/bk-build.sh test
28 changes: 28 additions & 0 deletions .github/workflows/container-push-base-images-develop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: container-push-base-images-develop

on:
push:
branches:
- develop
workflow_dispatch:

jobs:
push-store-image:
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: 'Log into GHCR'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{secrets.GH_PACKAGES_USER}}
password: ${{secrets.GH_PACKAGES_TOKEN}}
- name: 'Checkout current develop'
uses: actions/checkout@v3
with:
ref: "develop"
- name: 'Build stratos base images'
run: |
./deploy/stratos-base-images/build-base-images.sh -r ghcr.io -o anynines -p -s
43 changes: 43 additions & 0 deletions .github/workflows/frontend_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Frontend Tests

on:
push:
branches:
- develop
- master
pull_request:

env:
NODE_OPTIONS: --max-old-space-size=5500

jobs:
test_suite:
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16

- uses: actions/checkout@v2

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm install

- name: Run Tests
uses: coactions/setup-xvfb@v1
with:
run: npm run test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down Expand Up @@ -139,6 +140,9 @@ website/versioned_sidebars
website/versions.json
website/versions-repo

# Npm package builds
/npm_pkg

/scan_tmp

# Desktop app using Electron
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
### 4.5.0 - 2023-11-10
* Make builds work and abstract away architecture (#1)
* Improvements in vulnerability checking (#8)
* Fix the CVEs in the jetstream backend (#12)
* Fix backend unit tests (also code quality improvements) (#15)
* Theme Builder: Cast types (#16)
* Update required disk space (#17)
* Migrate to github.com/pressly/goose (#18)
* Move repository/interfaces to its own submodule: api (#19)
* Build and push base images on push to develop (#11)
* Add Helm support for local repos in desktop mode (#14)
* Fix dependency for database migrations (#20)
* Adapt https://github.com/cloudfoundry/stratos/pull/4580: Update store references in core package to refer to @stratosui/store (#26)
* Fix database migrations by casting dialect correctly (#22)
* add Github Actions for Backend and Frontend Tests (#29)
* Add script to help with building as packages and fix devkit and package info
* Fix typo (#31)
* Code quality improvements via `staticcheck` (#24)
* tidy up github action workflow for backend tests to resolve wrong golang version during tests (#32)
* Update to node v20 (#34)
* Remove sass-lint and stratos-protractor-reporter (#37)
* Apply changes from https://github.com/cloudfoundry/stratos/pull/4583 (#33)
* Upgrade code.cloudfoundry.org/cli to v8 (#42)
* Cherry pick commit 69ac7dc from other branch; now works without any restrictions; original commit message: (#45)
* fix gogoproto related panic when retrieving logs upgrade github.com/cloudfoundry/noaa/consumer to 2.3.0 (#46)
* Fix frontend CVEs (#40)
* feat: add errorz package to combine errors as enum in there (#47)
* allow newer pgsql versions (#51)

# Change Log

## 4.4.0
Expand Down
Loading

0 comments on commit 1172e4e

Please sign in to comment.