Remove unused mozversioncontrol functions
Categories
(Firefox Build System :: General, task, P3)
Tracking
(firefox111 fixed)
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: saschanaz, Assigned: gzyfqh)
References
Details
(Keywords: good-first-bug)
Attachments
(1 file)
Those include .base_ref
, .head_ref
, and get_upstream
.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
base_ref
and head_ref
are going to be called directly or indirectly by tools/tryselect/selectors/coverage.py
, or at least that seems to be the case from quick grep
ping. get_upstream
can probably go though.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 2•3 years ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Reporter | ||
Comment 4•2 years ago
•
|
||
I guess you can, although the reviewer should be #firefox-build-system-reviewers
this time. base_ref
and head_ref
are now used in https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/tools/tryselect/selectors/compare.py#36,40 as Ricky said above, while get_upstream
can go.
(In reply to Kagami [:saschanaz] from comment #4)
I guess you can, although the reviewer should be
#firefox-build-system-reviewers
this time.base_ref
andhead_ref
are now used in https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/tools/tryselect/selectors/compare.py#36,40 as Ricky said above, whileget_upstream
can go.
I still see .base_ref, .head_ref, and get_upstream. functions in the codebase.
Is there anything else I should be aware of when dealing with this bug?
Also, does the compare.py file you mentioned need to be modified?
Reporter | ||
Comment 6•2 years ago
|
||
(In reply to Ho Cheung from comment #5)>
I still see .base_ref, .head_ref, and get_upstream. functions in the codebase.
Where do you see get_upstream
? If it's in testing/web-platform/tests/
, you can ignore it as it has its own definition.
Is there anything else I should be aware of when dealing with this bug?
Also, does the compare.py file you mentioned need to be modified?
No, only https://searchfox.org/mozilla-central/source/python/mozversioncontrol/mozversioncontrol/__init__.py should be modified.
(In reply to Kagami [:saschanaz] from comment #6)
(In reply to Ho Cheung from comment #5)>
I still see .base_ref, .head_ref, and get_upstream. functions in the codebase.
Where do you see
get_upstream
? If it's intesting/web-platform/tests/
, you can ignore it as it has its own definition.Is there anything else I should be aware of when dealing with this bug?
Also, does the compare.py file you mentioned need to be modified?
No, only https://searchfox.org/mozilla-central/source/python/mozversioncontrol/mozversioncontrol/__init__.py should be modified.
In addition to the testing directory, I found get_upstream in the python directory and taskcluster directory
I will post a commit about this bug in the near future
Reporter | ||
Comment 8•2 years ago
|
||
In addition to the testing directory, I found get_upstream in the python directory
Those are the ones we want to remove here!
and taskcluster directory
That one is get_upstream_task_ref
, not get_upstream
.
(In reply to Kagami [:saschanaz] from comment #8)
In addition to the testing directory, I found get_upstream in the python directory
Those are the ones we want to remove here!
and taskcluster directory
That one is
get_upstream_task_ref
, notget_upstream
.
I just looked at the code and found that the three functions .base_ref, .head_ref and get_upstream are still in use (maybe my conclusion is incorrect?).
These three functions seem to pass some parameters.
Reporter | ||
Comment 10•2 years ago
|
||
The former two are indeed in use as said above. Not sure what you saw about get_upstream, can you point me to the file and the line number?
Assignee | ||
Comment 11•2 years ago
|
||
(In reply to Kagami [:saschanaz] from comment #10)
The former two are indeed in use as said above. Not sure what you saw about get_upstream, can you point me to the file and the line number?
Please see line 632 of the file in the link below
Reporter | ||
Comment 12•2 years ago
|
||
Good catch, and those are exactly the lines we want to remove here. Those are not "in use", rather those are function definitions that are never called and thus are redundant.
Assignee | ||
Comment 13•2 years ago
|
||
(In reply to Kagami [:saschanaz] from comment #12)
Good catch, and those are exactly the lines we want to remove here. Those are not "in use", rather those are function definitions that are never called and thus are redundant.
I plan to do this in an upcoming commit:
Delete lines 169-172, delete lines 433-435, and modify def get_upstream(self):
in line 632 to def upstream(self):
Am I doing this correctly?
Reporter | ||
Comment 14•2 years ago
|
||
I would remove them all, any specific reason you want to keep line 632?
Assignee | ||
Comment 15•2 years ago
|
||
(In reply to Kagami [:saschanaz] from comment #14)
I would remove them all, any specific reason you want to keep line 632?
I see that the function below also passes some parameters and returns some hints. There are also some function calls
I'm worried that removing this function like this will cause breaking changes
If this function can be removed, I will remove it later.
Reporter | ||
Comment 16•2 years ago
|
||
I see that the function below also passes some parameters and returns some hints.
Can you point to the lines you are worrying about? I'm pretty sure nothing calls get_upstream
. If it's not called, returning anything is not useful at all and can be removed.
Assignee | ||
Comment 17•2 years ago
|
||
(In reply to Kagami [:saschanaz] from comment #16)
I see that the function below also passes some parameters and returns some hints.
Can you point to the lines you are worrying about? I'm pretty sure nothing calls
get_upstream
. If it's not called, returning anything is not useful at all and can be removed.
Mainly lines 633-634 caused my concern, because this involves the modification of the build system, there are many developers and CI test robots should be using files related to the build system.
Reporter | ||
Comment 18•2 years ago
|
||
(In reply to Ho Cheung from comment #17)
Mainly lines 633-634 caused my concern, because this involves the modification of the build system, there are many developers and CI test robots should be using files related to the build system.
Searchfox shows no caller of get_upstream
, and that means there's no way for the developers and CI test robots to call that function. That means line 633-634 never runs, and thus can be removed.
Assignee | ||
Comment 19•2 years ago
|
||
(In reply to Kagami [:saschanaz] from comment #18)
(In reply to Ho Cheung from comment #17)
Mainly lines 633-634 caused my concern, because this involves the modification of the build system, there are many developers and CI test robots should be using files related to the build system.
Searchfox shows no caller of
get_upstream
, and that means there's no way for the developers and CI test robots to call that function. That means line 633-634 never runs, and thus can be removed.
ok i totally understand, thanks for your explanation
Reporter | ||
Comment 20•2 years ago
|
||
(In reply to Ho Cheung from comment #19)
ok i totally understand, thanks for your explanation
👍
Feel free to ask whenever you have any more doubts!
Assignee | ||
Comment 21•2 years ago
|
||
Remove unused mozversioncontrol functions in code
Depends on D167348
Updated•2 years ago
|
Assignee | ||
Comment 22•2 years ago
|
||
(In reply to Kagami [:saschanaz] from comment #20)
(In reply to Ho Cheung from comment #19)
ok i totally understand, thanks for your explanation
👍
Feel free to ask whenever you have any more doubts!
Is the reviewed code automatically merged into the code tree? Or do you manually push to the code tree?
Reporter | ||
Comment 23•2 years ago
|
||
Landing is done manually by the reviewer. I'll do that, thanks!
Comment 24•2 years ago
|
||
Comment 25•2 years ago
|
||
bugherder |
Description
•