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

Arc-2308 add backend ffs #183

Merged
merged 12 commits into from
Oct 9, 2023
Merged

Arc-2308 add backend ffs #183

merged 12 commits into from
Oct 9, 2023

Conversation

rachellerathbone
Copy link
Collaborator

What's in this PR?
Addition of feature flag module for backend.

Why
So we can make changes, roll them out, and not break shit!

Affected issues
Arc-2308

How has this been tested?
Locally and stg

What's Next?
Start using them 😄

18.17.0
Copy link
Collaborator Author

@rachellerathbone rachellerathbone Sep 26, 2023

Choose a reason for hiding this comment

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

Forge cli was complaining I was using an old version and was having issues running forge commands. Had to bump, which came parcelled with a need to change this. Will need to merge this PR straight after this one.

}

const envVars: EnvVars = {
LAUNCHDARKLY_API_KEY: process.env.LAUNCHDARKLY_API_KEY || '',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These have been set for the appId using some forge cli commands. For more info see https://developer.atlassian.com/platform/forge/environments-and-versions/

const errorMsg = `fetching feature flag unexpected status`;

try {
const response = await fetch(`${BASE_URL}/${featureFlagKey}`, { ...baseHeaders });
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using fetch to call the LD API as we currently can't use the @launchdarkly/node-server-sdk due to Forge's lack of support for the Node.js runtime. https://hello.atlassian.net/wiki/spaces/OTFS/pages/2803689031/Forge+Limitations Work is being done to add this support and we can opt in by being onboarded to a feature flag but doing some removed the ability to run forge tunnel locally... Figured this was our next best option.

@rachellerathbone rachellerathbone marked this pull request as ready for review September 26, 2023 04:52
@rachellerathbone rachellerathbone requested a review from a team as a code owner September 26, 2023 04:52

async function getFeatureFlag(featureFlagKey: string): Promise<FeatureFlag> {
const eventType = 'retrievingFeatureFlag';
const errorMsg = `fetching feature flag unexpected status`;
Copy link
Collaborator

@joshkay10 joshkay10 Oct 9, 2023

Choose a reason for hiding this comment

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

/nit ` without placeholder value and BASE_URL

joshkay10
joshkay10 previously approved these changes Oct 9, 2023
@joshkay10 joshkay10 self-requested a review October 9, 2023 04:00
@rachellerathbone rachellerathbone merged commit 8341f23 into main Oct 9, 2023
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.

2 participants