-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Clean up work on constants. #6919
Conversation
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.
Approving for question-player and practice-session files
@seanlip @kevinlee12 The setup test shows pending here while it has passed as I saw in the dashboard: Also, the frontend and backend tests are passing which implies that the setup test must have passed. |
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.
lgtm!
I think we can probably override it since this is because Github isn't reporting the correct status.
core/templates/dev/head/pages/topic-editor-page/topic-editor-page.constants.ts
Show resolved
Hide resolved
No, we need to fix it so that GitHub reports the correct status. I am not
overriding without all checks passing.
|
Oh, that said, I am not too concerned about "setup" if the others do pass. (I made the original response via email.) /cc @oppia/dev-workflow-team any idea why this is happening? |
@seanlip The other tests do pass! Could this be merged then? |
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.
Hi @YashJipkate, took a pass, and I have a question. I think each constant should be declared exactly once in all of Oppia. I'm fine having a policy of "if a constant is used more than once, put it at app level", though there may be other better ways of handling this.
What are the policies that you would like to put in place, in order to achieve this? I would also like the presubmit checks that force this policy to be followed in the future to be part of this PR, so that devs don't (accidentally) undo the work you've done to separate them properly.
...mplates/dev/head/components/question-directives/question-editor/question-editor.constants.ts
Outdated
Show resolved
Hide resolved
core/templates/dev/head/pages/exploration-editor-page/exploration-editor-page.constants.ts
Outdated
Show resolved
Hide resolved
core/templates/dev/head/pages/exploration-player-page/exploration-player-page.constants.ts
Outdated
Show resolved
Hide resolved
core/templates/dev/head/pages/practice-session-page/practice-session-page.constants.ts
Outdated
Show resolved
Hide resolved
@vojtechjelinek @Jamesjay4199 Flagging this comment, PTAL. |
I have already addressed that comment, Sorry for not saying the same on the thread.
I thought that you meant this was something @Jamesjay4199 would have as a TODO. MIght be some misunderstanding of mine. |
.github/CODEOWNERS
Outdated
@@ -314,6 +314,8 @@ | |||
/core/jobs*.py @seanlip | |||
/core/platform/ @seanlip | |||
/core/templates/dev/head/App*.ts @ankita240796 | |||
/core/templates/dev/head/app.constants.ts @ankita240796 | |||
/core/templates/dev/head/pages/interaction-specs.contants.ts @ankita240796 |
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.
@seanlip I am not sure about this. Could you confirm?
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 would say @vojtechjelinek (what do you think, @vojtechjelinek)?
But shouldn't that check have caught the case of INTERACTION_SPECS being repeated in the codebase, if it was working correctly? |
@seanlip The tests now pass (on my local). PTAL! |
I had an exception for INTERACTION_SPECS in the linter so it is exempted. |
.github/CODEOWNERS
Outdated
@@ -314,6 +314,8 @@ | |||
/core/jobs*.py @seanlip | |||
/core/platform/ @seanlip | |||
/core/templates/dev/head/App*.ts @ankita240796 | |||
/core/templates/dev/head/app.constants.ts @ankita240796 | |||
/core/templates/dev/head/pages/interaction-specs.contants.ts @ankita240796 |
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 would say @vojtechjelinek (what do you think, @vojtechjelinek)?
@@ -347,6 +347,15 @@ | |||
'/scripts/install_third_party.sh', | |||
'/.github/'] | |||
|
|||
OLD_CONVENTION_DIRECTORIES = [ | |||
'core/templates/dev/head/services', | |||
'core/templates/dev/head/base_components', |
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.
Isn't this new? It wasn't around in the "old" codebase...
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 don't think I understood you completely. These are the directories which follow the old convention and hence the name.
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 guess I was thinking that base_components seems to have been recently added and is here to stay? I thought the idea was that all "new" dirs are cleaned up and we were going to remove all the dirs in this list completely over time... (which, btw, merits an issue or a TODO).
Are we planning to delete base_components too?
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.
No, it doesn't need to be deleted. It just means that it is following the old convention. When we will empty this list out, it would mean that these directories now follow the new convention.
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. I think you missed adding both an issue and a TODO for this (see previous comment). We need some way of keeping track of the task of "making this list empty".
Also add a comment above line 350 to explain to new devs what this constant is (in particular what is meant by "old convention").
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 have added a comment as well a TODO. PTAL.
Hi @YashJipkate. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks! |
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.
Basically LGTM. Thanks @YashJipkate!
Is this PR blocking future work? If so, then if Travis tests pass you are welcome to incorporate the changes from here in the next PR instead, so that we can get this in.
@@ -347,6 +347,15 @@ | |||
'/scripts/install_third_party.sh', | |||
'/.github/'] | |||
|
|||
OLD_CONVENTION_DIRECTORIES = [ | |||
'core/templates/dev/head/services', | |||
'core/templates/dev/head/base_components', |
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. I think you missed adding both an issue and a TODO for this (see previous comment). We need some way of keeping track of the task of "making this list empty".
Also add a comment above line 350 to explain to new devs what this constant is (in particular what is meant by "old convention").
Hi @seanlip. No, this is not blocking any of my work currently (the one actually blocking is #6939) since work on Angular migration on constants can only begin after hybridization which is blocked by #6939. This PR is just a preparation for the next task after hybridization. So I am fine addressing your review comments in this PR itself! |
Thanks @YashJipkate! Full LGTM from me. But please file an issue for #6919 (comment), assign it to yourself, and plan to take care of it as part of your project. |
Also since this change is mechanical I am happy to merge it once the Travis checks pass. |
Sure, that's fine, as long as it's tracked. Are you planning to take that up? (I don't want that list of folders to stay in the linter script as a long-term thing...) |
OK @seanlip I will try to do that right away in a follow up PR since that needs to be done sooner or later! |
Thanks, @YashJipkate! I will merge this one now. |
Also the tests pass. Could this be merged? Edit: Thanks for merging! |
Explanation
This PR is a clone of #6915.
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.