Skip to content
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
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/hc/en-us/requests/new) or by emailing support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support request
url: https://support.launchdarkly.com/hc/en-us/requests/new
about: File your support requests with LaunchDarkly's support team
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
9 changes: 9 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Build Documentation
description: 'Build Documentation.'

runs:
using: composite
steps:
- name: Build Documentation
shell: bash
run: cd docs && make html
25 changes: 25 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI Workflow
description: 'Shared CI workflow.'
inputs:
ruby-version:
description: 'The version of ruby to setup and run'
required: true

runs:
using: composite
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}

- name: Install dependencies
shell: bash
run: bundle install

- name: Run tests
shell: bash
run: bundle exec rspec spec

- name: Run RuboCop
shell: bash
run: bundle exec rubocop --parallel
15 changes: 15 additions & 0 deletions .github/actions/publish-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish Documentation
description: 'Publish the documentation to GitHub Pages'
inputs:
token:
description: 'Token to use for publishing.'
required: true

runs:
using: composite
steps:
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
name: 'Publish to Github pages'
with:
docs_path: docs/build/html/
github_token: ${{inputs.token}} # For the shared action the token should be a GITHUB_TOKEN<
28 changes: 28 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Package
description: 'Publish the package to rubygems'
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
required: true
outputs:
gem-hash:
description: "base64-encoded sha256 hashes of distribution files"
value: ${{ steps.gem-hash.outputs.gem-hash }}

runs:
using: composite
steps:
- name: Build gemspec
shell: bash
run: gem build launchdarkly-server-sdk-ai.gemspec

- name: Hash gem for provenance
id: gem-hash
shell: bash
run: |
echo "gem-hash=$(sha256sum launchdarkly-server-sdk-ai-*.gem | base64 -w0)" >> "$GITHUB_OUTPUT"

- name: Publish Library
shell: bash
if: ${{ inputs.dry_run == 'false' }}
run: gem push launchdarkly-server-sdk-ai-*.gem
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**Requirements**

- [ ] I have added test coverage for new or changed functionality
- [ ] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform versions

**Related issues**

Provide links to any issues in this repository or elsewhere relating to this pull request.

**Describe the solution you've provided**

Provide a clear and concise description of what you expect to happen.

**Describe alternatives you've considered**

Provide a clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context about the pull request here.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Run CI
on:
push:
branches: [ main, 'feat/**' ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main, 'feat/**' ]
paths-ignore:
- '**.md'

jobs:
build-linux:
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- jruby-9.4

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # If you only need the current version keep this.

- uses: ./.github/actions/ci
with:
ruby-version: ${{ matrix.ruby-version }}

- uses: ./.github/actions/build-docs
if: ${{ !startsWith(matrix.ruby-version, 'jruby') }}

build-windows:
runs-on: windows-latest

defaults:
run:
shell: powershell

steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

- name: Install dependencies
run: bundle install

- name: Run tests
run: bundle exec rspec spec
12 changes: 12 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint PR title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
lint-pr-title:
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
22 changes: 22 additions & 0 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
workflow_dispatch:

name: Publish Documentation
jobs:
build-publish-docs:
runs-on: ubuntu-latest
permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Needed in this case to write github pages.
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

- uses: ./.github/actions/build-docs

- uses: ./.github/actions/publish-docs
with:
token: ${{secrets.GITHUB_TOKEN}}
70 changes: 70 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish Package
on:
workflow_call:
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
tag_name:
description: 'The tag name to use for the provenance file'
type: string
required: true

workflow_dispatch:
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true

jobs:
build-publish:
runs-on: ubuntu-latest
# Needed to get tokens during publishing.
permissions:
id-token: write
contents: read
outputs:
gem-hash: ${{ steps.publish.outputs.gem-hash}}
steps:
- uses: actions/checkout@v4

- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
name: 'Get rubygems API key'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/rubygems/api_key = GEM_HOST_API_KEY'

- id: build-and-test
name: Build and Test
uses: ./.github/actions/ci
with:
ruby-version: 3.0

- id: build-docs
name: Build docs
uses: ./.github/actions/build-docs

- id: publish
name: Publish Package
uses: ./.github/actions/publish
with:
dry_run: ${{ inputs.dry_run }}

- uses: ./.github/actions/publish-docs
if: ${{ steps.release.outputs.releases_created == 'true' }}
with:
token: ${{secrets.GITHUB_TOKEN}}

release-provenance:
needs: [ 'build-publish' ]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
with:
base64-subjects: "${{ needs.build-publish.outputs.gem-hash }}"
upload-assets: ${{ !inputs.dry_run }}
upload-tag-name: ${{ needs.release-package.outputs.upload-tag-name }}
27 changes: 27 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Please

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write # Contents and pull-requests are for release-please to make releases.
pull-requests: write
outputs:
release-created: ${{ steps.release.outputs.release_created }}
tag-name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release

release-sdk:
needs: release-please
if: ${{ needs.release-please.outputs.release-created == 'true' }}
uses: ./.github/workflows/publish.yml
with:
dry_run: false
tag_name: ${{ needs.release-please.outputs.tag-name }}
10 changes: 10 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
# Happen once per day at 1:30 AM
- cron: '30 1 * * *'

jobs:
sdk-close-stale:
uses: launchdarkly/gh-actions/.github/workflows/sdk-stale.yml@main
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.0"
}
Loading