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

Issue 0 implement feature flagging #43

Merged
merged 7 commits into from
Jul 28, 2024
Merged

Conversation

Idrinth
Copy link
Collaborator

@Idrinth Idrinth commented Jul 27, 2024

The Pull Request is ready

  • all github actions are passing
  • only a single issue was worked on
  • refs CLI: Feature Flag Solution #30
  • the branch follows the naming schema issue-123-enable-x-does-not-disable-y
  • the pull request has a sensible title

Intention

With this change I intend to provide a basic implementation for a feature flagging service.

Review Points

Please take extra care reviewing the error handling, since I had to provide a lot of fallbacks for broken configurations or unreachable remote hosts.

The code follows best practices

  • duplicate code has been extracted where possible
  • issues for follow-up tasks have been created
  • tests have been written for any new functionality
  • there is no any type used
  • texts have been checked for grammar and spelling issues

Notes

This current solution uses websockets to prevent the clients from having to pull. We can easily move it to a rest-api if desired.

@Idrinth Idrinth requested a review from rphovley July 27, 2024 10:15
@Idrinth Idrinth marked this pull request as draft July 27, 2024 10:15
@Idrinth Idrinth requested a review from kadenbaskett July 27, 2024 10:43
@Idrinth Idrinth marked this pull request as ready for review July 27, 2024 10:48
Copy link
Member

@rphovley rphovley left a comment

Choose a reason for hiding this comment

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

Don't have enough time this morning to do a full review yet. Just left one comment so far


const file = './codeclimbers.identity'

export class FileStore implements Store {
Copy link
Member

Choose a reason for hiding this comment

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

Nice implementation! Looks like this should work well. curious why you chose to write this to file instead of the db? It does feel weird to create an entire table to store and retrieve one record

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The main reason was preventing the server and config locking each other out of the database by either both accessing the file or by them cross-depending on each other to start up.

Copy link
Member

@rphovley rphovley left a comment

Choose a reason for hiding this comment

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

Really good work Bjorn! I'm excited to interact with this in the app

@@ -0,0 +1,30 @@
export class Flag {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like a good candidate for unit tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The flag itself will be quick to test, would do this in the next step(including testing more stuff)

data[0].json(),
data[1].json(),
])
console.log(envList, idList)
Copy link
Member

Choose a reason for hiding this comment

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

Log 🙃

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed, ty

} catch (error) {
// @todo logging
}
console.log(this.flags)
Copy link
Member

Choose a reason for hiding this comment

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

Log 🙃

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed, ty

// @todo log somewhere
return new Flag(flagName, false, false, false, false)
}
private async loadFlags() {
Copy link
Member

Choose a reason for hiding this comment

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

Decent amount going on here. Are there any behaviors here we can test?

Copy link
Member

Choose a reason for hiding this comment

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

Looks like there are network calls here that might make testing more difficult and I don't really care to test networking rn. Potentially could test the second half if that half is cohesive as its own function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm happy to refactor that, would just due to size reasons not want to do the testing and refactoring here.

"url": "https://github.com/idrinth"
},
"scripts": {
"start": "node index.js",
Copy link
Member

Choose a reason for hiding this comment

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

What will be managing this websocket server when the CLI is distributed? Will oclif start and manage both as a systemd?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that would be the intention, yes

@Idrinth Idrinth requested a review from rphovley July 28, 2024 09:24
Copy link
Member

@rphovley rphovley left a comment

Choose a reason for hiding this comment

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

Looks good Bjorn!

@Idrinth Idrinth merged commit 581cfd2 into main Jul 28, 2024
8 of 9 checks passed
@Idrinth Idrinth deleted the issue-0-implement-feature-flagging branch July 28, 2024 19:09
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