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

fix: clone feature toggle should not copy createdAt #6442

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

ivarconr
Copy link
Member

@ivarconr ivarconr commented Mar 5, 2024

This is a small fix to avoid that cloning a feature toggle also clones the "createdAt" field, which does not make sense.

fixes: #6426

Copy link

vercel bot commented Mar 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 7:19pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2024 7:19pm

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: FAILED

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 2 files(s) 🔥

Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

@@ -1324,6 +1324,7 @@ class FeatureToggleService {
...cToggle,
name: newFeatureName,
variants: undefined,
createdAt: undefined,

Choose a reason for hiding this comment

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

ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1983 to 1984, improve code health by reducing it to 1000

Why does this problem occur?

The number of Lines of Code in a single file. More Lines of Code lowers the code health. Read more.

@@ -1324,6 +1324,7 @@ class FeatureToggleService {
...cToggle,
name: newFeatureName,
variants: undefined,
createdAt: undefined,

Choose a reason for hiding this comment

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

❌ Getting worse: Large Method
FeatureToggleService.cloneFeatureToggle increases from 77 to 78 lines of code, threshold = 70

Why does this problem occur?

Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function. Read more.

To ignore this warning click here.

@@ -2191,6 +2191,42 @@ test('should clone feature toggle without replacing groupId', async () => {
});
});

test('should clone feature toggle WITHOUT createdAt field', async () => {

Choose a reason for hiding this comment

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

ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 3119 to 3152, improve code health by reducing it to 1000

Why does this problem occur?

The number of Lines of Code in a single file. More Lines of Code lowers the code health. Read more.

@@ -2191,6 +2191,42 @@ test('should clone feature toggle without replacing groupId', async () => {
});
});

test('should clone feature toggle WITHOUT createdAt field', async () => {

Choose a reason for hiding this comment

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

ℹ Getting worse: Number of Functions in a Single Module
The number of functions increases from 104 to 105, threshold = 75

Why does this problem occur?

This file contains too many functions. Beyond a certain threshold, more functions lower the code health. Read more.

Copy link
Contributor

@gastonfournier gastonfournier 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!

@ivarconr ivarconr merged commit 2185742 into main Mar 6, 2024
14 of 15 checks passed
@ivarconr ivarconr deleted the fix/clone-createdaT branch March 6, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cloned feature toggles clone "created at" too
2 participants