Skip to content

Commit

Permalink
refactor to use options pattern throughout (#5)
Browse files Browse the repository at this point in the history
* refactor to use options pattern throughout

* change bkpipeline back to versioned image and pre-commit output

* cleanup

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* more

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* remove extras

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* renames, add some additional functions for ease of use

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* add coverge out artfiact

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* coverage.out

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* no latest tag

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* remove html output

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* fix test I broke

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* README and other cleanups

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

* one more

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>

---------

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
Co-authored-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
  • Loading branch information
matoszz and golanglemonade authored Sep 4, 2024
1 parent 661ceaa commit 50a81ab
Show file tree
Hide file tree
Showing 59 changed files with 6,077 additions and 6,112 deletions.
25 changes: 13 additions & 12 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ env:
IMAGE_REPO: ghcr.io/theopenlane/${APP_NAME}
SONAR_HOST: "https://sonarcloud.io"
steps:
- group: ":test_tube: tests"
- group: ":test_tube: Tests"
key: "tests"
steps:
- label: ":golangci-lint: lint :lint-roller:"
cancel_on_build_failing: true
key: "lint"
cancel_on_build_failing: true
plugins:
- docker#v5.11.0:
image: "registry.hub.docker.com/golangci/golangci-lint:v1.60.3"
command: ["golangci-lint", "run", "-v", "--timeout", "10m", "--config", ".golangci.yaml", "--concurrency", "0"]
image: "ghcr.io/theopenlane/build-image:latest"
always-pull: true
command: ["task", "go:lint"]
environment:
- "GOTOOLCHAIN=auto"
- label: ":golang: go test"
key: "go_test"
retry:
automatic:
- exit_status: "*"
limit: 2
cancel_on_build_failing: true
plugins:
- docker#v5.11.0:
image: golang:1.23.0
command: ["go", "test", "-coverprofile=coverage.out", "./..."]
image: "ghcr.io/theopenlane/build-image:latest"
always-pull: true
command: ["task", "go:test:cover"]
environment:
- "GOTOOLCHAIN=auto"
artifact_paths: ["coverage.out"]
- group: ":closed_lock_with_key: Security Checks"
depends_on: "go_test"
Expand All @@ -37,6 +37,7 @@ steps:
- docker#v5.11.0:
image: "registry.hub.docker.com/securego/gosec:2.20.0"
command: ["-no-fail", "-exclude-generated", "-fmt sonarqube", "-out", "results.txt", "./..."]
always-pull: true
environment:
- "GOTOOLCHAIN=auto"
artifact_paths: ["results.txt"]
Expand All @@ -51,7 +52,7 @@ steps:
download: "coverage.out"
step: "go_test"
- docker#v5.11.0:
image: "sonarsource/sonar-scanner-cli:5"
image: "sonarsource/sonar-scanner-cli:11"
environment:
- "SONAR_TOKEN"
- "SONAR_HOST_URL=$SONAR_HOST"
Expand All @@ -67,7 +68,7 @@ steps:
download: coverage.out
step: "go_test"
- docker#v5.11.0:
image: "sonarsource/sonar-scanner-cli:5"
image: "sonarsource/sonar-scanner-cli:11"
environment:
- "SONAR_TOKEN"
- "SONAR_HOST_URL=$SONAR_HOST"
25 changes: 12 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# Contributing

Please read the [contributing](.github/CONTRIBUTING.md) guide as well as the [Developer Certificate of Origin](https://developercertificate.org/). You will be required to sign all commits to the Openlane project, so if you're unfamiliar with how to set that up, see [github's documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification).

Given external users will not have write to the branches in this repository, you'll need to follow the forking process to open a PR - [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) is a guide from github on how to do so.

Please also read our main [contributing guide](https://github.com/theopenlane/.github/blob/main/CONTRIBUTING.md) in addition to this one; the main guide mostly says that we'd like for you to open an issue first but it's not hard-required, and that we accept all forms of proposed changes given the state of this code base (in it's infancy, still!)
## Licensing

This repository contains open source software that comprises the Openlane stack which is open source software under [Apache 2.0](LICENSE). Openlane's SaaS / Cloud Services are products produced from this open source software exclusively by theopenlane, Inc. This product is produced under our published commercial terms (which are subject to change). Any logos or trademarks in our repositories in [theopenlane](https://github.com/theopenlane) organization are not covered under the Apache License and are trademarks of theopenlane, Inc.

## Pre-requisites to a PR
Others are allowed to make their own distribution of this software or include this software in other commercial offerings, but cannot use any of the Openlane logos, trademarks, cloud services, etc.

This repository contains a number of code generating functions / utilities which take schema modifications and scaffold out resolvers, graphql API schemas, openAPI specifications, among other things. To ensure you've generated all the necessary dependencies run `task pr`; this will run the entirety of the commands required to safely generate a PR. If for some reason one of the commands fails / encounters an error, you will need to debug the individual steps. It should be decently easy to follow the `Taskfile` in the root of this repository.
## Security

### Pre-Commit Hooks
We take the security of our software products and services seriously, including our commercial services and all of the open source code repositories managed through our Github Organizations, such as [theopenlane](https://github.com/theopenlane). If you believe you have found a security vulnerability in any of our repositories or in our SaaS offering(s), please report it to us through coordinated disclosure.

We have several `pre-commit` hooks that should be run before pushing a commit. Make sure this is installed:
**Please do NOT report security vulnerabilities through public github issues, discussions, or pull requests!**

```bash
brew install pre-commit
pre-commit install
```
Instead, please send an email to `security@theopenlane.io` with as much information as possible to best help us understand and resolve the issues. See the security policy attached to this repository for more details.

You can optionally run against all files:
## Questions?

```bash
pre-commit run --all-files
```
You can email us at `info@theopenlane.io`, open a github issue in this repository, or reach out to [matoszz](https://github.com/matoszz) directly.
127 changes: 0 additions & 127 deletions .github/workflows/releaser.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
run:
timeout: 10m
allow-serial-runners: true
concurrency: 0
linters-settings:
goimports:
local-prefixes: github.com/theopenlane/httpsling
Expand Down Expand Up @@ -37,5 +38,6 @@ issues:
fix: true
exclude-use-default: true
exclude-dirs:
- totp/testing/*
exclude-files:
- httptestutil/*
exclude-files:
- example_test.go
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
default_stages: [pre-commit]
fail_fast: true
default_language_version:
golang: system

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -14,6 +11,6 @@ repos:
hooks:
- id: yamlfmt
- repo: https://github.com/crate-ci/typos
rev: v1.24.1
rev: v1.22.7
hooks:
- id: typos
Empty file removed .trivyignore
Empty file.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024, The Open Lane, Inc.
Copyright 2024, theopenlane, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 50a81ab

Please sign in to comment.