-
Notifications
You must be signed in to change notification settings - Fork 150
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
a fix for duplicate alias problem #3010
Merged
Merged
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
cf2ce74
a fix for duplicate alias problem
godplayer56 b78811e
This commit corrects the formatting for python files
godplayer56 9f9b6df
removed the settings.json file
godplayer56 8f5f13b
adding test for checking duplicate alias
godplayer56 9cc67e2
fixing formatting errors
godplayer56 8c5eaec
added two tests and updated rules.py
godplayer56 450e1ae
changes to rules.py
godplayer56 e3ed332
added new condition
godplayer56 898c330
added test for /scheduled_changes/rules
godplayer56 59bc8a3
corrected formatting error
godplayer56 e3fb94c
completed the second test
godplayer56 5ce07b4
trying to fix build errors
godplayer56 2254047
formatting errors
godplayer56 c870770
added two more tests with different update types
godplayer56 7fa4c05
adding exception for tests
godplayer56 399ee9a
fixing backend test errors
godplayer56 9051216
added and assertion
godplayer56 2ca2d73
updated tests
godplayer56 167b56a
added data_version
godplayer56 0f6f3cb
tests updated
godplayer56 c46d589
updated the error message
godplayer56 aef0681
base_alias -> alias
godplayer56 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is not quite right, unfortunately. It is testing the
/rules
view - which is already covered bybalrog/tests/admin/views/test_rules.py
Line 540 in 6493a9e
You should be adding at least two tests:
/scheduled_changes/rules
, and one that validates a POST to/scheduled_changes/rules/:sc_id
. The first could be modeled afterbalrog/tests/admin/views/test_rules.py
Line 2161 in 6493a9e
balrog/tests/admin/views/test_rules.py
Line 2251 in 6493a9e
In both cases the request should a result in a 400 if any of the following are true:
rules
tablerule_scheduled_changes
table that meets both the following conditions:complete
is Falsechange_type
isinsert
orupdate
(This may require additional changes to
rules.py
as well - please let me know if you have any questions.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll start working on updating the test 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhearsum I have a doubt regarding this -
How do I select the required data in the
rule_scheduled_change
table? for eg-for the
rules
table we have thegetAlias
function defined to get the rule with the given alias but forrule_scheduled_changes
I am not able to figure out how should I select the data with a given alias.and also does the column
scheduled_by
denote the alias for therule_scheduled_changes
table?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
scheduled_changes
table is accessible throughdbo.rules.scheduled_changes
(You can see an example query in the testsbalrog/tests/admin/views/test_rules.py
Line 2012 in 6d46207
No --
scheduled_by
is the person who scheduled the change :). The alias is in thebase_alias
column in the scheduled changes table (apologies -- I forgot about that detail when I posted the earlier comment).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it! 😄