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

Feature: Add support for default account override #1349

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

kemmerle
Copy link
Contributor

@kemmerle kemmerle commented Jan 22, 2025

Description and Context

Relies on HubSpot/hubspot-local-dev-lib#228

In this PR, I'm implementing support for default account overrides with the new centralized configuration file.

Now, customers can place a .hs-account file in any directory where they would like the default account overridden. The .hs-account file will contain a single numerical entry: 1234567, or the account ID. Any changes made in the directory and its subdirectories will apply in the account stipulated in the .hs-account file. This will work very similarly to our nest configs currently do.

The advantages are:

  1. We will still have one centralized configuration file and therefore one single source of truth.
  2. We will create a command to auto-generate the .hs-account file, so that customers need never have to manually interact with the config.
  3. It's much more secure, if a customer accidentally uploads the file to GitHub--it contains no sensitive information besides an account ID.

TODO

  • Implement the hs accounts create-override command
  • Address feedback

Who to Notify

@brandenrodgers @camden11 @joe-yeager

@kemmerle kemmerle changed the title Add error messages for default account override Feature: Add support for default account override Jan 22, 2025
@kemmerle kemmerle changed the title Feature: Add support for default account override Feature (WIP): Add support for default account override Jan 22, 2025
@kemmerle kemmerle marked this pull request as ready for review January 23, 2025 15:35
bin/cli.js Outdated Show resolved Hide resolved
bin/cli.js Outdated Show resolved Hide resolved
@kemmerle kemmerle changed the title Feature (WIP): Add support for default account override Feature: Add support for default account override Feb 5, 2025
lib/doctor/Doctor.ts Outdated Show resolved Hide resolved
brandenrodgers
brandenrodgers previously approved these changes Feb 6, 2025
Copy link
Contributor

@brandenrodgers brandenrodgers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a merge conflict, but this lgtm 👌

Copy link
Contributor

@joe-yeager joe-yeager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I have some questions about the doctor changes being made, but that doesn't need to hold up this PR and we can always fast follow changes if we decide to make them.

Comment on lines +127 to +142
if (this.diagnosticInfo?.defaultAccountOverrideFile) {
this.diagnosis?.addDefaultAccountOverrideFileSection({
type: 'warning',
message: i18n(`${localI18nKey}.overrideActive`, {
defaultAccountOverrideFile:
this.diagnosticInfo.defaultAccountOverrideFile,
}),
});
this.diagnosis?.addDefaultAccountOverrideFileSection({
type: 'warning',
message: i18n(`${localI18nKey}.overrideAccountId`, {
overrideAccountId: getCWDAccountOverride(),
}),
});
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do any checks on the validity of the account? Should these be warnings by default?

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.

3 participants