Skip to content

Commit

Permalink
Merge pull request #2 from SolaceProducts/v1.0.0-release
Browse files Browse the repository at this point in the history
v1.0.0 release
  • Loading branch information
cjwmorgan-sol authored Jan 31, 2024
2 parents 4b248b7 + 5e25564 commit 30d1a3a
Show file tree
Hide file tree
Showing 83 changed files with 81,876 additions and 202 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test

# Controls when the workflow will run
on: [push, pull_request, workflow_dispatch]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Linux:
# The type of runner that the job will run on
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: 'stable'
check-latest: true

- name: Compiles
run: |
go mod tidy
go build ./...
- name: Runs go fmt
if: ${{ success() }}
run: |
OUTPUT=$(go fmt ./... 2>&1)
if [ ! -z "$OUTPUT" ]; then
echo "go fmt failed on the following files:"
echo "$OUTPUT"
exit 1
fi
- name: Runs unit tests
if: ${{ success() }}
run: go test -coverprofile ./unitcoverage.out ./...

- name: Generates the SEMPv2 client
if: ${{ success() }}
run: |
go generate .
working-directory: ./test/sempclient

- name: Runs the integration tests
if: ${{ success() }}
run: |
mkdir reports
go install github.com/onsi/ginkgo/v2/[email protected]
ginkgo --junit-report=./reports/report.xml -coverprofile ./reports/coverage.out -coverpkg solace.dev/go/messaging-trace/opentelemetry/internal/...,solace.dev/go/messaging-trace/opentelemetry/... -tags enable_debug_logging
working-directory: ./test

- name: Uploads artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
path: |
./unitcoverage.out
./test/reports/report.xml
./test/reports/coverage.out
./test/diagnostics.tgz
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,27 @@

# Go workspace file
go.work

.DS_STORE

.vscode

# Removing the commented out includes
# lib/*/bin*
# lib/*/lib*
# lib/*/include*

test/reports
test/diagnostics.tgz

test/sempclient/action/*
!test/sempclient/action/go.mod
!test/sempclient/action/go.sum

test/sempclient/config/*
!test/sempclient/config/go.mod
!test/sempclient/config/go.sum

test/sempclient/monitor/*
!test/sempclient/monitor/go.mod
!test/sempclient/monitor/go.sum
77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

65 changes: 65 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## How to Contribute to a Solace Project

#### **Did you find a bug?**

* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/SolaceProducts/pubsubplus-opentelemetry-go-integration/issues).

* If you're unable to find an open issue that addresses the problem, [open a new one](https://github.com/SolaceProducts/pubsubplus-opentelemetry-go-integration/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

#### **Do you intend to add a new feature or change an existing one?**

* Open a GitHub [enhancement request issue](https://github.com/SolaceProducts/pubsubplus-opentelemetry-go-integration/issues/new) and describe the new functionality.

#### **Do you have questions about the source code?**

* Ask any question about the code or how to use Solace PubSub+ OpenTelemetry Integration API in the [Solace community](https://solace.dev/community/).

## Developer Guide

### Overview

The Solace PubSub+ OpenTelemetry Integration API for Go is used to handle injection and extraction of tracing information for carrier objects (Solace message) for a Solace PubSub+ Event Broker. It has a dependency on the [Solace PubSub+ Messaging API for Go](https://docs.solace.com/API/Messaging-APIs/Go-API/go-home.htm).

### Repository Contents

The following are the directories that are part of the repository:
- `./`: contains the API's main entrypoints such as tracing.
- `carrier`: contains the API's carrier interfaces
- `internal`: contains the implementation for the PubSub+ OpenTelemetry Integration API for Go
- `logging`: contains the API's logging interfaces, constants and basic data structures
- `test`: contains integration tests for the PubSub+ OpenTelemetry Integration API for Go

### Prerequisites

There are a handful of prerequisites for developing the Solace PubSub+ OpenTelemetry Integration API for Go:
- Golang version 1.17+
- A golang enabled code editor, preferably with format on save
- https://github.com/fatih/vim-go
- https://code.visualstudio.com/docs/languages/go
- (optional) Docker used for testing
- (optional) Godoc Static to generate a static version of the documentation

Note:
- The integration tests are their own go module. This is currently not compatible with the [go language server](https://github.com/golang/tools/blob/master/gopls/README.md) which is the default used in VS Code. In particular, there is only support for a single module per workspace. The solution to this is to open the tests in their own workspace.

### Testing

Any new features added to the API must have corresponding tests added to the [integration test project](./test). See [the test README](./test/README.md) for details on running the tests. Any new feature must not decrease overall test coverage.

#### Github Actions

The integration tests are run on every new commit via Github Actions. These tests are run on the latest Go version on Linux.

### Generating Documentation

Documentation should work in all cases using `godoc` in the module and navigating to the local webserver.

#### Generating Static Documentation

In addition, static documentation can be generated. To do this, first install godoc-static, and then run `go run docs-templates/generate_documentation.go`.
50 changes: 50 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// pubsubplus-opentelemetry-go-integration
//
// Copyright 2021-2024 Solace Corporation. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// The following is an internal infrastructure file for building
properties([
buildDiscarder(logRotator(daysToKeepStr: '30', numToKeepStr: '10')),
])
currentBuild.rawBuild.getParent().setQuietPeriod(0)

library 'jenkins-pipeline-library@main'

/*
Go Version examples:
auto-v1.17.x: Latest patch of 1.17 release
auto-v1.17.2: Specific patch of 1.17 release
auto-v1.17.0: First release of 1.17 (Despite go versioning this as 1.17)
auto-latest: Most recent patch version of latest minor release
auto-previous: Most recent patch version of previous minor release
auto-2previous: Most recent patch version of second last minor release
Adoption of new versions into these may be delayed.
*/

builder.goapi([
"buildCheckGoVer": 'auto-v1.20.0',
"validationGoVer": 'auto-v1.20.0',
"staticCheckPkg": 'honnef.co/go/tools/cmd/[email protected]',
"getTestPermutations": {
List<List<String>> permutations = []
for (platform in [builder.LINUX_ARM, builder.LINUX_X86_64, builder.LINUX_MUSL, builder.DARWIN_X86_64, builder.DARWIN_ARM]) {
for (gover in ['auto-latest', 'auto-previous']) {
permutations << [platform, gover]
}
}
return permutations
}
])
Loading

0 comments on commit 30d1a3a

Please sign in to comment.