Filip Troníček 04f590de85
Organization onboarding welcome message (#20577)
* squashed (- oidc/newUser)

Tool: gitpod/catfood.gitpod.cloud

* [server, db] Cleanup UpdateOrgSettings API handling

Tool: gitpod/catfood.gitpod.cloud

* [dashboard] Render WelcomeMessage based on a) user.createdAt and b) localStorage

Tool: gitpod/catfood.gitpod.cloud

* [api, server] Add missing update_allowed_workspace_classes field

Tool: gitpod/catfood.gitpod.cloud

* [dashboard] Fix updateOrgSettings API usage

Tool: gitpod/catfood.gitpod.cloud

* [dashboard, server] Fix duration handling/conversion

Tool: gitpod/catfood.gitpod.cloud

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2025-02-14 08:14:50 -05:00
..
2025-02-14 02:17:50 -05:00

Public API TypeScript Common

Overview

This package serves as a bridge for code conversion between two distinct Gitpod packages: @gitpod/gitpod-protocol and @gitpod/public-api. Its primary responsibility is to ensure seamless translation of application data structures from the gitpod-protocol format to the public-api gRPC format, and vice versa.

Allowed Usage

Use this package exclusively for tasks that require data structure from @gitpod/gitpod-protocol and @gitpod/public-api. It's important not to introduce dependencies on this package from gitpod-protocol or public-api to ensure changes in one package don't trigger rebuilds of unrelated components such as ws-manager-bridge and supervisor-frontend.

Golden tests

Golden tests are used to test the output of a function against a known good output. The output is stored in a file with the same name as the test file but with a .golden extension. The test will fail if the output does not match the golden file.

We use golden tests for public api data conversion functions. We put the fixtures input and golden results in the ../fixtures folder.

See example below:

it("toOrganizationMember", async () => {
    await startFixtureTest("../fixtures/toOrganizationMember_*.json", async (input) =>
        converter.toOrganizationMember(input),
    );
});

it will run the test for each file matching the glob pattern ../fixtures/toOrganizationMember_*.json. The test will fail if the output does not match the ../fixtures/toOrganizationMember_*.golden files.

How to veirfy golden files

yarn test

How to update golden files

yarn test:forceUpdate

How to generate input json files

node scripts/new-fixtures.js [your_testing_name] [the_number_of_input_files]