Skip to content

Remove unused home page files - #1209

Merged
cdolfi merged 1 commit into
devfrom
fix/cache-empty-repolist-error-handling
Oct 29, 2026
Merged

cdolfi merged 1 commit into
devfrom
fix/cache-empty-repolist-error-handling

Conversation

@EngCaioFonseca

@EngCaioFonseca EngCaioFonseca commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

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 its register_page call has been commented out since. Dash still imported home.py, because Dash loads any page file containing the text register_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 by how_8knot_works_section.py and is kept.

Generative AI disclosure

Please select one option:

  • This contribution was NOT assisted or created by Generative AI tools.
  • This contribution was assisted or created by Generative AI tools.

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.

@EngCaioFonseca EngCaioFonseca self-assigned this Sep 4, 2026
@EngCaioFonseca EngCaioFonseca added the bug Something isn't working label Sep 4, 2026
@EngCaioFonseca EngCaioFonseca moved this from Backlog to Testing | Waiting on PR response | Blocked in Aspen Project Board Sep 4, 2026
@EngCaioFonseca
EngCaioFonseca force-pushed the fix/cache-empty-repolist-error-handling branch from 584a066 to 1b18321 Compare September 14, 2026 22:25
@EngCaioFonseca
EngCaioFonseca marked this pull request as ready for review September 14, 2026 22:35
@cdolfi

cdolfi commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Do we have any examples of these errors happening? What prompted the making of this PR?

@cdolfi

cdolfi commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Discussed during team meeting that this would be updated to take out legacy used code rather than add error handling to it

@EngCaioFonseca

Copy link
Copy Markdown
Contributor Author

Just needs to be modified to removing dead/unused code.

@EngCaioFonseca
EngCaioFonseca force-pushed the fix/cache-empty-repolist-error-handling branch 2 times, most recently from 3fdb7d8 to 744f11d Compare October 13, 2026 12:49
@EngCaioFonseca EngCaioFonseca changed the title Fix/cache empty repolist error handling Removing dead/unused code on the branch Oct 13, 2026
@EngCaioFonseca EngCaioFonseca removed the bug Something isn't working label Oct 13, 2026
@EngCaioFonseca
EngCaioFonseca force-pushed the fix/cache-empty-repolist-error-handling branch from 744f11d to 4125b47 Compare October 13, 2026 13:08
Comment thread 8Knot/cache_manager/cache_facade.py Outdated
Comment on lines +120 to +116
def get_uncached(func_name: str, repolist: list[int]) -> list[int]: # or None
def get_uncached(func_name: str, repolist: list[int]) -> list[int]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment on lines +235 to +239
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):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines -25 to -43
# 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"),
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if this is a dead code PR, this is more of the kind of thing that id consider in scope

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is not dead code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@cdolfi

cdolfi commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

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

@EngCaioFonseca

EngCaioFonseca commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

@EngCaioFonseca
EngCaioFonseca force-pushed the fix/cache-empty-repolist-error-handling branch from 4125b47 to 3dc7c8f Compare October 27, 2026 12:21
@EngCaioFonseca EngCaioFonseca changed the title Removing dead/unused code on the branch Remove unused home page files Oct 27, 2026
@EngCaioFonseca EngCaioFonseca moved this from Backlog to In Testing in CollectOSS + 8Knot WG Feature Roadmap Oct 27, 2026

@cdolfi cdolfi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@cdolfi

cdolfi commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

@EngCaioFonseca Do you know why the end to end test is failing?

@cdolfi

cdolfi commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

once conflicts are resolves im good to merge

@MoralCode

Copy link
Copy Markdown
Contributor

@EngCaioFonseca Do you know why the end to end test is failing?

Logs
✅✅✅ MATCH pattern 7: 'Listening at: http://0.0.0.0:8080/'
app-server-1      | [2026-10-27 15:40:12 +0000] [1] [INFO] Using worker: gthread
app-server-1      | [2026-10-27 15:40:12 +0000] [5] [INFO] Booting worker with pid: 5
worker-callback-1  | 2026-10-27 15:40:13,001 WARNING  AUGUR: Connection to DB succeeded
✅✅✅ MATCH pattern 6: 'AUGUR: Connection to DB succeeded'
✅✅✅✅✅ All patterns matched. ✅✅✅✅✅
 Container 8knot-reverse-proxy-1 Stopping 
 Container 8knot-mock-db-1 Stopping 
 Container 8knot-reverse-proxy-1 Stopped 
 Container 8knot-reverse-proxy-1 Removing 
 Container 8knot-reverse-proxy-1 Removed 
 Container 8knot-app-server-1 Stopping 
 Container 8knot-mock-db-1 Stopped 
 Container 8knot-mock-db-1 Removing 
 Container 8knot-mock-db-1 Removed 
 Container 8knot-app-server-1 Stopped 
 Container 8knot-app-server-1 Removing 
 Container 8knot-app-server-1 Removed 
 Container 8knot-worker-callback-1 Stopping 
 Container 8knot-worker-query-1 Stopping 
 Container 8knot-worker-callback-1 Stopped 
 Container 8knot-worker-callback-1 Removing 
 Container 8knot-worker-callback-1 Removed 
 Container 8knot-worker-query-1 Stopped 
 Container 8knot-worker-query-1 Removing 
 Container 8knot-worker-query-1 Removed 
 Container 8knot-db-init-1 Stopping 
 Container 8knot-db-init-1 Stopped 
 Container 8knot-db-init-1 Removing 
 Container 8knot-db-init-1 Removed 
 Container 8knot-redis-broker-1 Stopping 
 Container 8knot-redis-users-1 Stopping 
 Container 8knot-postgres-cache-1 Stopping 
 Container 8knot-postgres-cache-1 Stopped 
 Container 8knot-postgres-cache-1 Removing 
 Container 8knot-postgres-cache-1 Removed 
 Container 8knot-redis-users-1 Stopped 
 Container 8knot-redis-users-1 Removing 
 Container 8knot-redis-users-1 Removed 
 Container 8knot-redis-broker-1 Error Error while Stopping
Error response from daemon: removing container 29ee0adbe1a76265567ddeae5e7deae5e442117dd930a9e0f880f98403d9dc9d network: 1 error occurred:
	* rootless netns: kill network process: permission denied
Error: executing /usr/libexec/docker/cli-plugins/docker-compose -f docker-compose.yml down: exit status 1
Error: Process completed with exit code 1.

Seems to be some error with stopping the test containers. the test itself is passing.

Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
@EngCaioFonseca
EngCaioFonseca force-pushed the fix/cache-empty-repolist-error-handling branch from 3dc7c8f to 74f81df Compare October 29, 2026 14:08

@cdolfi cdolfi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@cdolfi
cdolfi merged commit 930400b into dev Oct 29, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants