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: builds filter #474

Merged
merged 1 commit into from
Oct 31, 2024
Merged

fix: builds filter #474

merged 1 commit into from
Oct 31, 2024

Conversation

@WilsonNet
Copy link
Collaborator

please explain in the commit why this is fixing the problem

Copy link
Collaborator

@WilsonNet WilsonNet left a comment

Choose a reason for hiding this comment

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

working great, just some minor pointers

@anajalvarenga
Copy link
Contributor Author

please explain in the commit why this is fixing the problem

@WilsonNet Before the changes, the treeCommitsHistory and treeDetailsView views were unable to handle more than one filter using the same field (and even if it worked it wouldn't be able to deal with where to put AND or OR). So I created get_grouped_filters to group all values ​​in an array into the same filter object. However, I received some errors in the query when dealing with a filter that only had one value in the array. Therefore, to avoid changing every query to always check whether it has one value or more, I decided to change the code in just one place, defining a string at first and changing it to an array when adding more values

Copy link
Collaborator

@WilsonNet WilsonNet left a comment

Choose a reason for hiding this comment

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

nice

Comment on lines 163 to 164
grouped_filters[field] = f
grouped_filters[field]['value'] = value
Copy link
Collaborator

Choose a reason for hiding this comment

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

f already has the value property right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, f is something like this {'field': 'valid', 'value': 'false', 'comparison_op': 'exact'}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I got it, line 164 is unnecessary

value = f['value']
if field not in grouped_filters:
grouped_filters[field] = f
grouped_filters[field]['value'] = value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason for this line?

@Francisco2002
Copy link
Collaborator

The History Chart in Boot/Test Tab are with a wrong behavior

Wrong Correct
wrongBootChart correctBootChart
wrongTestChart correctTestChart

@anajalvarenga
Copy link
Contributor Author

The History Chart in Boot/Test Tab are with a wrong behavior

Wrong Correct
wrongBootChart correctBootChart
wrongTestChart correctTestChart

@Francisco2002 In this PR I only worked on Views builds, so the changes do not affect the data in the boots/tests tab. Furthermore, I also tested the graphs now and they have the same staging behavior. How do you get this error?

localhost staging
image image

@Francisco2002
Copy link
Collaborator

The History Chart in Boot/Test Tab are with a wrong behavior
Wrong Correct
wrongBootChart correctBootChart
wrongTestChart correctTestChart

@Francisco2002 In this PR I only worked on Views builds, so the changes do not affect the data in the boots/tests tab. Furthermore, I also tested the graphs now and they have the same staging behavior. How do you get this error?
localhost staging
image image

My bad.
I test again and this strange behavior don't occurred again.

Before the changes, the treeCommitsHistory and treeDetailsView views were unable to handle more than one filter using the same field (and even if it worked it wouldn't be able to deal with where to put AND or OR). So I created get_grouped_filters to group all values ​​in an array into the same filter object. However, I received some errors in the query when dealing with a filter that only had one value in the array. Therefore, to avoid changing every query to always check whether it has one value or more, I decided to change the code in just one place, defining a string at first and changing it to an array when adding more values

Closes #438
@Francisco2002 Francisco2002 merged commit 6eac69a into main Oct 31, 2024
5 checks passed
@Francisco2002 Francisco2002 deleted the fix/builds-filter branch November 13, 2024 19:04
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.

Tree Details: Bug on filter builds
4 participants