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

feat: stop sending metrics when CLI command is executed on CI/CD pipeline #10

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export default abstract class extends Command {

recorderFromEnv(prefix: string): Recorder {
let sink: Sink = new DiscardSink();
if (process.env.ASYNCAPI_METRICS !== 'false') {

if (process.env.ASYNCAPI_METRICS !== 'false' && process.env.CI !== 'true') {
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't be this an OR rather than an AND?

Suggested change
if (process.env.ASYNCAPI_METRICS !== 'false' && process.env.CI !== 'true') {
if (process.env.ASYNCAPI_METRICS !== 'false' || process.env.CI !== 'true') {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure about it 🤔
What if ASYNCAPI_METRICS = 'true' and CI = 'true'? In that situation we would be sending metrics when applying the OR condition. So if that scenario is possible, shouldn't we apply the AND condition instead?

Copy link
Owner

Choose a reason for hiding this comment

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

You are right 👍

switch (process.env.NODE_ENV) {
case 'development':
// NODE_ENV set to `development` in bin/run
Expand Down
Loading