Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make organization source required #5137

Open
wants to merge 1 commit into
base: report-BP-id-to-bugsnag
Choose a base branch
from

Conversation

amcaplan
Copy link
Contributor

@amcaplan amcaplan commented Dec 22, 2024

WHY are these changes introduced?

Makes the source field required in the Organization type to ensure consistent handling of organization sources across the codebase. This prevents potential undefined behavior when dealing with organization sources, and - most relevant here - allows us to be sure we can report analytics with the correct org ID field.

WHAT is this pull request doing?

Makes the source field non-optional in the Organization interface and updates all test files to include the required source field in organization objects. The changes ensure that organizations always have a defined source, either BusinessPlatform or Partners.

How to test your changes?

Not much to test per se, I'd suggest tophatting with downstream PRs. All we're doing is being more strict about field requirements.

Measuring impact

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

amcaplan commented Dec 22, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

Copy link
Contributor

github-actions bot commented Dec 22, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.35% (+0.02% 🔼)
8840/11732
🟡 Branches
70.61% (+0.02% 🔼)
4290/6076
🟡 Functions 75.2% 2314/3077
🟡 Lines
75.88% (+0.02% 🔼)
8357/11013

Test suite run success

1994 tests passing in 900 suites.

Report generated by 🧪jest coverage report action from e746586

@amcaplan amcaplan force-pushed the make-organization-source-required branch from 9ebb294 to e746586 Compare December 22, 2024 19:24
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/monorail.d.ts
@@ -16,6 +16,7 @@ export interface Schemas {
             env_plugin_installed_all?: Optional<string>;
         };
         public: {
+            business_platform_id?: Optional<number>;
             partner_id?: Optional<number>;
             command: string;
             project_type?: Optional<string>;
packages/cli-kit/dist/public/node/plugins.d.ts
@@ -16,7 +16,7 @@ import { Config, Interfaces } from '@oclif/core';
  * @returns A dictionary of plug-in names to the response from the hook.
  */
 export declare function fanoutHooks<TPluginMap extends HookReturnsPerPlugin, TEvent extends string & keyof TPluginMap>(config: Interfaces.Config, event: TEvent, options: TPluginMap[typeof event]['options'], timeout?: number): Promise<Partial<TPluginMap[typeof event]['pluginReturns']>>;
-type AppSpecificMonorailFields = PickByPrefix<MonorailEventPublic, 'app_', 'project_type' | 'api_key' | 'partner_id'> & PickByPrefix<MonorailEventPublic, 'cmd_extensions_'> & PickByPrefix<MonorailEventPublic, 'cmd_scaffold_'>;
+type AppSpecificMonorailFields = PickByPrefix<MonorailEventPublic, 'app_', 'project_type' | 'api_key' | 'partner_id' | 'business_platform_id'> & PickByPrefix<MonorailEventPublic, 'cmd_extensions_'> & PickByPrefix<MonorailEventPublic, 'cmd_scaffold_'>;
 type AppSpecificSensitiveMonorailFields = PickByPrefix<MonorailEventSensitive, 'app_'>;
 export interface HookReturnsPerPlugin extends HookReturnPerTunnelPlugin {
     public_command_metadata: {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant