Repository navigation
Remove unused home page files - #1209
Conversation
584a066 to
1b18321
Compare
|
Do we have any examples of these errors happening? What prompted the making of this PR? |
|
Discussed during team meeting that this would be updated to take out legacy used code rather than add error handling to it |
|
Just needs to be modified to removing dead/unused code. |
3fdb7d8 to
744f11d
Compare
744f11d to
4125b47
Compare
| def get_uncached(func_name: str, repolist: list[int]) -> list[int]: # or None | ||
| def get_uncached(func_name: str, repolist: list[int]) -> list[int]: |
There was a problem hiding this comment.
did we evaluate whether we are no longer returning None?
seems like the happy path might return none since we call cache_query_results but dont actually return anything in that case
There was a problem hiding this comment.
the get_uncached always returns a list or raises, so the # or none was out of date. The get_uncached has no None path, it returns not_cached (a list) or raises. In caching_wrapper, the happy path already returned none and only the "all cached" early exit returned 0.
There was a problem hiding this comment.
Even if that function returns a list, we are not using it with a return call, so it becomes a none at this point in the code
| while not_cached := cf.get_uncached(func_name=rfq.__name__, repolist=repos): | ||
| while cf.get_uncached(func_name=rfq.__name__, repolist=repos): | ||
| logging.warning(f"CONTRIBUTION FILE HEATMAP - WAITING ON DATA TO BECOME AVAILABLE") | ||
| time.sleep(0.5) | ||
|
|
||
| # wait for data to asynchronously download and become available. | ||
| while not_cached := cf.get_uncached(func_name=prfq.__name__, repolist=repos): | ||
| while cf.get_uncached(func_name=prfq.__name__, repolist=repos): | ||
| logging.warning(f"CONTRIBUTION FILE HEATMAP - WAITING ON DATA TO BECOME AVAILABLE") | ||
| time.sleep(0.5) | ||
|
|
||
| # wait for data to asynchronously download and become available. | ||
| while not_cached := cf.get_uncached(func_name=prq.__name__, repolist=repos): | ||
| while cf.get_uncached(func_name=prq.__name__, repolist=repos): |
There was a problem hiding this comment.
seems like we are making some pretty sweeping changes across the repo in this PR. This makes me want to know more about the circumstances leading to this change, i.e. was a human or a tool the original/first source of noticing this dead code?
Im really hesitant to merge changes touching so many files without a clear/specific benefit as to how this helps solve a problem we are facing now. Refactoring small things like this may help for cleanup, and small line level changes to standardize code style are helpful when paired with linting tools to keep the style that way, but im not sure if these types of changes fit in a PR thats presented as "error handling" (branch name) or "cleaning up dead code" (PR title).
Overall i think im just confused about what the goal is here
There was a problem hiding this comment.
Like my comment below, I'll rescope the branch to only remove specific dead/unused code.
However, everything presently in this PR was reviewed iteratively to ensure that indeed they are either dead or unused code.
But like I said, I understand the scope issue, which I ended up extended in the PR, so I'll move back to only the areas touched in this PR before so it is clearer and in scope.
| # graph displayed if a worker fails | ||
| timeout_graph = go.Figure([go.Bar(x=columns, y=[20, 14, 23])]) | ||
| timeout_graph.update_traces( | ||
| marker_color="rgb(230,230,230)", | ||
| marker_line_color="rgb(200,200,300)", | ||
| marker_line_width=1.5, | ||
| opacity=0.6, | ||
| ) | ||
| timeout_graph.update_layout( | ||
| title={ | ||
| "text": "No Available Data", | ||
| "y": 0.9, | ||
| "x": 0.5, | ||
| "xanchor": "center", | ||
| "yanchor": "top", | ||
| }, | ||
| font=dict(size=18, color="orange"), | ||
| ) | ||
|
|
There was a problem hiding this comment.
if this is a dead code PR, this is more of the kind of thing that id consider in scope
There was a problem hiding this comment.
The PR removed dead or unused code. This snippet of code is not referenced anywhere in the repo anymore. There's no using of timeout_graph anymore since the 174df20 commit (in Nov 2022). It was used by the old job-queue. The file it is still in use, but not this part. For example, nodata_graph is used, but not timeout_graph.
There was a problem hiding this comment.
I am going to restore it due to the scope issue. However, I also leave it up to you guys, since the git history shows it as being unused since late 2022.
lmk what you think
|
My original feedback was to take out the code from the home page where there is full files not being used not touching files that are still active |
Yeah, I can agree with that, in terms of scope, I can go back to only touching those files if that's what's wanted. But the idea is not removing files that are still in use, but rather code sections in there that are not used anymore. It could be the case they are not dead code, but they are unused code, superseded by new functions. That's the case from the job_utils for example. There's still files that are active, but have unused code in there, that was the idea. |
4125b47 to
3dc7c8f
Compare
|
@EngCaioFonseca Do you know why the end to end test is failing? |
|
once conflicts are resolves im good to merge |
LogsSeems to be some error with stopping the test containers. the test itself is passing. |
Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
3dc7c8f to
74f81df
Compare
Pull Request Change Description
Removes files from the home page that nothing in the app uses. Every file still in use is unchanged.
8Knot/pages/home/: the old Home page. It was taken off when the Welcome page replaced it, and itsregister_pagecall has been commented out since. Dash still importedhome.py, because Dash loads any page file containing the textregister_page, comments included. So its 13 background callbacks were registered at startup, but their outputs aren't in any layout and they never ran.8Knot/pages/landing/sections/how_8knot_works_architecture.py: a Welcome-page section that hasn't been imported since 19ff6c4 (2025-09). The image it showed,8knot_works.png, is still used byhow_8knot_works_section.pyand is kept.Generative AI disclosure
Please select one option:
If AI tools were used, please provide details below:
- What tools were used? Claude Opus 5, GPT 5.6 - sol, GPT 6 - Astra.
- How were these tools used? Draft, multiple iterations, review.
- Did you review these outputs before submitting this PR? Yes.