Skip to content

Commit

Permalink
Merge branch 'main' into server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Sep 11, 2023
2 parents 1db6db9 + 6876f69 commit 5f04888
Show file tree
Hide file tree
Showing 19 changed files with 133 additions and 39 deletions.
30 changes: 30 additions & 0 deletions .github/actions/sdk-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ inputs:
required: true
sdk_cmake_target:
description: 'CMake target of the sdk, e.g. launchdarkly-cpp-client.'
outputs:
hashes-linux:
description: "base64-encoded sha256 hash of linux build artifacts"
value: ${{ steps.hash-linux.outputs.hashes-linux }}
hashes-windows:
description: "base64-encoded sha256 hash of windows build artifacts"
value: ${{ steps.hash-windows.outputs.hashes-windows }}
hashes-macos:
description: "base64-encoded sha256 hash of macos build artifacts"
value: ${{ steps.hash-macos.outputs.hashes-macos }}

runs:
using: composite
Expand Down Expand Up @@ -56,6 +66,12 @@ runs:
type: 'zip'
filename: 'linux-gcc-x64-dynamic.zip'

- name: Hash Linux Build Artifacts for provenance
if: runner.os == 'Linux'
shell: bash
id: hash-linux
run: |
echo "hashes-linux=$(sha256sum linux-gcc-x64-static.zip linux-gcc-x64-dynamic.zip | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Upload Linux Build Artifacts
if: runner.os == 'Linux'
Expand Down Expand Up @@ -118,6 +134,13 @@ runs:
type: 'zip'
filename: 'windows-msvc-x64-dynamic-debug.zip'

- name: Hash Windows Build Artifacts for provenance
if: runner.os == 'Windows'
shell: bash
id: hash-windows
run: |
echo "hashes-windows=$(sha256sum windows-msvc-x64-static.zip windows-msvc-x64-dynamic.zip windows-msvc-x64-static-debug.zip windows-msvc-x64-dynamic-debug.zip | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Upload Windows Build Artifacts
if: runner.os == 'Windows'
shell: bash
Expand Down Expand Up @@ -157,6 +180,13 @@ runs:
type: 'zip'
filename: 'mac-clang-x64-dynamic.zip'

- name: Hash Mac Build Artifacts for provenance
if: runner.os == 'macOS'
shell: bash
id: hash-macos
run: |
echo "hashes-macos=$(shasum -a 256 mac-clang-x64-static.zip mac-clang-x64-dynamic.zip | base64 -b 0)" >> "$GITHUB_OUTPUT"
- name: Upload Mac Build Artifacts
if: runner.os == 'macOS'
shell: bash
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/manual-sdk-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
# Each of the platforms for which release-artifacts need generated.
os: [ ubuntu-latest, windows-2022, macos-12 ]
runs-on: ${{ matrix.os }}
outputs:
hashes-linux: ${{ steps.release-sdk.outputs.hashes-linux }}
hashes-windows: ${{ steps.release-sdk.outputs.hashes-windows }}
hashes-macos: ${{ steps.release-sdk.outputs.hashes-macos }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -50,3 +54,19 @@ jobs:
github_token: ${{secrets.GITHUB_TOKEN}}
sdk_path: ${{ needs.split-input.outputs.sdk_path}}
sdk_cmake_target: ${{ needs.split-input.outputs.sdk_cmake_target}}
release-sdk-provenance:
needs: ['release-sdk']
strategy:
matrix:
# Generates a combined attestation for each platform
os: [ linux, windows, macos ]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.release-sdk.outputs[format('hashes-{0}', matrix.os)] }}"
upload-assets: true
upload-tag-name: ${{ inputs.tag }}
provenance-name: ${{ format('{0}-multiple.intoto.jsonl', matrix.os) }}
21 changes: 21 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [ 'release-please' ]
if: ${{ needs.release-please.outputs.package-client-released }}
outputs:
hashes-linux: ${{ steps.release-client.outputs.hashes-linux }}
hashes-windows: ${{ steps.release-client.outputs.hashes-windows }}
hashes-macos: ${{ steps.release-client.outputs.hashes-macos }}
steps:
- uses: actions/checkout@v3
- id: release-client
Expand All @@ -37,3 +41,20 @@ jobs:
github_token: ${{secrets.GITHUB_TOKEN}}
sdk_path: 'libs/client-sdk'
sdk_cmake_target: 'launchdarkly-cpp-client'

release-client-provenance:
needs: ['release-client']
strategy:
matrix:
# Generates a combined attestation for each platform
os: [ linux, windows, macos ]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.release-client.outputs[format('hashes-{0}', matrix.os)] }}"
upload-assets: true
upload-tag-name: ${{ needs.release-please.outputs.package-client-tag }}
provenance-name: ${{ format('{0}-multiple.intoto.jsonl', matrix.os) }}
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"libs/client-sdk": "3.0.6",
"libs/server-sent-events": "0.1.1",
"libs/common": "0.3.4",
"libs/internal": "0.1.7"
"libs/client-sdk": "3.0.7",
"libs/server-sent-events": "0.1.2",
"libs/common": "0.3.5",
"libs/internal": "0.1.8"
}
15 changes: 15 additions & 0 deletions libs/client-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to the LaunchDarkly Client-Side SDK for C/C++ will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org).

## [3.0.7](https://github.com/launchdarkly/cpp-sdks/compare/launchdarkly-cpp-client-v3.0.6...launchdarkly-cpp-client-v3.0.7) (2023-08-31)


### Bug Fixes

* allow for specification of initial reconnect delay in streaming data source ([#229](https://github.com/launchdarkly/cpp-sdks/issues/229)) ([d1dde79](https://github.com/launchdarkly/cpp-sdks/commit/d1dde79fde80cc32e19cf384140e138ce64ca02b))


### Dependencies

* The following workspace dependencies were updated
* dependencies
* launchdarkly-cpp-internal bumped from 0.1.7 to 0.1.8
* launchdarkly-cpp-common bumped from 0.3.4 to 0.3.5

## [3.0.6](https://github.com/launchdarkly/cpp-sdks/compare/launchdarkly-cpp-client-v3.0.5...launchdarkly-cpp-client-v3.0.6) (2023-08-29)


Expand Down
2 changes: 1 addition & 1 deletion libs/client-sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.19)

project(
LaunchDarklyCPPClient
VERSION 3.0.6 # {x-release-please-version}
VERSION 3.0.7 # {x-release-please-version}
DESCRIPTION "LaunchDarkly C++ Client SDK"
LANGUAGES CXX C
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class Client : public IClient {

private:
inline static char const* const kVersion =
"3.0.6"; // {x-release-please-version}
"3.0.7"; // {x-release-please-version}
std::unique_ptr<IClient> client;
};

Expand Down
7 changes: 4 additions & 3 deletions libs/client-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "launchdarkly-cpp-client",
"description": "This package.json exists for modeling dependencies for the release process.",
"version": "3.0.6",
"version": "3.0.7",
"private": true,
"dependencies": {
"launchdarkly-cpp-internal": "0.1.7",
"launchdarkly-cpp-common": "0.3.4"
"launchdarkly-cpp-internal": "0.1.8",
"launchdarkly-cpp-common": "0.3.5",
"launchdarkly-cpp-sse-client": "0.1.2"
}
}
2 changes: 1 addition & 1 deletion libs/client-sdk/tests/client_c_bindings_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEST(ClientBindings, MinimalInstantiation) {

char const* version = LDClientSDK_Version();
ASSERT_TRUE(version);
ASSERT_STREQ(version, "3.0.6"); // {x-release-please-version}
ASSERT_STREQ(version, "3.0.7"); // {x-release-please-version}

LDClientSDK_Free(sdk);
}
Expand Down
2 changes: 1 addition & 1 deletion libs/client-sdk/tests/client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TEST(ClientTest, ClientConstructedWithMinimalConfigAndContext) {

char const* version = client.Version();
ASSERT_TRUE(version);
ASSERT_STREQ(version, "3.0.6"); // {x-release-please-version}
ASSERT_STREQ(version, "3.0.7"); // {x-release-please-version}
}

TEST(ClientTest, AllFlagsIsEmpty) {
Expand Down
6 changes: 6 additions & 0 deletions libs/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
* dependencies
* launchdarkly-cpp-sse-client bumped from 0.1.0 to 0.1.1

### Dependencies

* The following workspace dependencies were updated
* dependencies
* launchdarkly-cpp-sse-client bumped from 0.1.1 to 0.1.2

## [0.3.4](https://github.com/launchdarkly/cpp-sdks/compare/launchdarkly-cpp-common-v0.3.3...launchdarkly-cpp-common-v0.3.4) (2023-08-28)


Expand Down
27 changes: 9 additions & 18 deletions libs/common/include/launchdarkly/bindings/c/context_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@ LDContextBuilder_AddKind(LDContextBuilder builder,
char const* key);

/**
* Add or update an attribute in the specified kind.
* Add or update a top-level attribute in the specified kind.
*
* Adding a LDValue to the builder will consume that value.
* You should not access the value after adding it to the builder, and you
* do not need to call LDValue_Free on the value.
*
* @param builder. The builder. Must not be NULL.
* @param kind The kind to add the attribute to. Must not be NULL.
* @param attr_key The key of the attribute to add. Must not be NULL.
* @param attr_name The name of the attribute to add. Must not be NULL.
* @param val The value of the attribute to add. Must not be NULL.
*/
LD_EXPORT(bool)
LDContextBuilder_Attributes_Set(LDContextBuilder builder,
char const* kind,
char const* attr_key,
char const* attr_name,
LDValue val);

/**
Expand All @@ -96,6 +97,7 @@ LDContextBuilder_Attributes_Set(LDContextBuilder builder,
* convenience which also adds the attribute to the private attributes list,
* as if using LDContextBuilder_Attributes_AddPrivateAttribute.
*
* @param builder The builder. Must not be NULL.
* @param kind The kind to set the private attribute for. Must not be NULL.
* @param attr_key The key of the private attribute. Must not be NULL.
* @param val The value of the private attribute. Must not be NULL.
Expand All @@ -114,6 +116,7 @@ LDContextBuilder_Attributes_SetPrivate(LDContextBuilder builder,
* This method will make a copy of the name string, and the caller remains
* responsible for the original name string.
*
* @param builder The builder. Must not be NULL.
* @param kind The kind to set the name for. Must not be NULL.
* @param name The name to set. Must not be NULL.
*/
Expand All @@ -128,6 +131,7 @@ LDContextBuilder_Attributes_SetName(LDContextBuilder builder,
* If true, the context will _not_ appear on the Contexts page in the
* LaunchDarkly dashboard.
*
* @param builder The builder. Must not be NULL.
* @param kind The kind to set the anonymous attribute for. Must not be NULL.
* @param anonymous The value to set the anonymous attribute to.
*/
Expand Down Expand Up @@ -166,27 +170,14 @@ LDContextBuilder_Attributes_SetAnonymous(LDContextBuilder builder,
* The attributes "kind" and "key", and the "_meta" attributes cannot be
* made private.
*
* In this example, firstName is marked as private, but lastName is not:
*
* ```
* [TODO]
* ```
*
* This is a metadata property, rather than an attribute that can be
* addressed in evaluations: that is, a rule clause that references the
* attribute name "privateAttributes", will not use this value, but would
* use a "privateAttributes" attribute set on the context.
*
* This method will make a copy of the attr_ref string, and the caller remains
* responsible for the original name string.
*
* @param builder The builder. Must not be NULL.
* @param kind The kind to set the attribute as private for. Must not be NULL.
* @param attr_ref An attribute reference. Must not be NULL.
*/
LD_EXPORT(bool)
LDContextBuilder_Attributes_AddPrivateAttribute(LDContextBuilder builder,
char const* kind,
char const* attr_key);
char const* attr_ref);
#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LD_EXPORT(void) LDObjectBuilder_Free(LDObjectBuilder builder);
* be accessed, and the caller doesn't need to call LDValue_Free. The key will
* be copied.
*
* @param array_builder The object builder to add the value to.
* @param builder The object builder to add the value to.
* @param key The key for the value being added. Must not be NULL.
* @param val The value to add. Must not be NULL.
*/
Expand Down
2 changes: 1 addition & 1 deletion libs/common/include/launchdarkly/bindings/c/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ LD_EXPORT(void) LDValue_Free(LDValue val);

/**
* Returns the type of an LDValue.
* @param value LDValue to inspect. Must not be NULL.
* @param val LDValue to inspect. Must not be NULL.
* @return Type of the LDValue, or LDValueType_Unrecognized if the type is
* unrecognized.
*/
Expand Down
7 changes: 2 additions & 5 deletions libs/common/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "launchdarkly-cpp-common",
"description": "This package.json exists for modeling dependencies for the release process.",
"version": "0.3.4",
"private": true,
"dependencies": {
"launchdarkly-cpp-sse-client": "0.1.1"
}
"version": "0.3.5",
"private": true
}
6 changes: 6 additions & 0 deletions libs/internal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
* dependencies
* launchdarkly-cpp-common bumped from 0.3.3 to 0.3.4

### Dependencies

* The following workspace dependencies were updated
* dependencies
* launchdarkly-cpp-common bumped from 0.3.4 to 0.3.5

## [0.1.5](https://github.com/launchdarkly/cpp-sdks/compare/launchdarkly-cpp-internal-v0.1.4...launchdarkly-cpp-internal-v0.1.5) (2023-06-30)


Expand Down
4 changes: 2 additions & 2 deletions libs/internal/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "launchdarkly-cpp-internal",
"description": "This package.json exists for modeling dependencies for the release process.",
"version": "0.1.7",
"version": "0.1.8",
"private": true,
"dependencies": {
"launchdarkly-cpp-common": "0.3.4"
"launchdarkly-cpp-common": "0.3.5"
}
}
7 changes: 7 additions & 0 deletions libs/server-sent-events/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.1.2](https://github.com/launchdarkly/cpp-sdks/compare/launchdarkly-cpp-sse-client-v0.1.1...launchdarkly-cpp-sse-client-v0.1.2) (2023-08-31)


### Bug Fixes

* allow for specification of initial reconnect delay in streaming data source ([#229](https://github.com/launchdarkly/cpp-sdks/issues/229)) ([d1dde79](https://github.com/launchdarkly/cpp-sdks/commit/d1dde79fde80cc32e19cf384140e138ce64ca02b))

## [0.1.1](https://github.com/launchdarkly/cpp-sdks/compare/launchdarkly-cpp-sse-client-v0.1.0...launchdarkly-cpp-sse-client-v0.1.1) (2023-06-30)


Expand Down
2 changes: 1 addition & 1 deletion libs/server-sent-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "launchdarkly-cpp-sse-client",
"description": "This package.json exists for modeling dependencies for the release process.",
"private": true,
"version": "0.1.1",
"version": "0.1.2",
"dependencies": {}
}

0 comments on commit 5f04888

Please sign in to comment.