Skip to content

Conversation

@Hijanhv
Copy link

@Hijanhv Hijanhv commented Nov 3, 2025

πŸ“‹ Overview

This pull request addresses Issue #133 β€” "Improve Code Readability with More Descriptive Naming."
Shortened or unclear identifiers have been replaced with more descriptive and expressive ones across the backend and frontend codebases.
This enhances maintainability, self-documentation, and readability for all contributors.

🧩 Backend Changes

  • Replaced abbreviated variables with full descriptive names:
    • cfg β†’ configuration
    • svc β†’ inference_service
    • gvk β†’ group_version_kind
    • FILE_ABS_PATH β†’ ABSOLUTE_FILE_PATH
  • Renamed helper functions:
    • inference_service_gvk() β†’ inference_service_group_version_kind()
    • _get_k8s_object() β†’ _get_kubernetes_object()
  • Unified constant naming:
    • K8S_* β†’ KUBERNETES_*
  • Added clearer docstrings and improved code comments.

πŸ’» Frontend Changes

  • Improved naming consistency across Angular components:
    • currNamespace β†’ currentNamespace
    • pollSub β†’ pollingSubscription
    • nsSub β†’ namespaceSubscription
    • svc β†’ inferenceService
  • Added types/kubeflow.d.ts for shared type definitions.
  • Enhanced dialog and configuration clarity:
    • config β†’ dialogConfig
    • res β†’ dialogResponse
  • Explicitly defined name/value pairs in chip components.
  • Updated tsconfig.app.json paths for type safety.

βš™οΈ GitHub Workflow Updates

  • Improved readability and spacing in .github/workflows/*.yaml files.
  • Standardized step comments and conditional blocks for better consistency.

🌟 Benefits

  • Improved readability and onboarding experience.
  • More self-documenting codebase.
  • Consistent naming conventions across frontend and backend.
  • Stronger typing and maintainability.

βœ… Checklist

πŸ”— Linked Issue

Closes #133

@Hijanhv Hijanhv force-pushed the feature/descriptive-names branch from 564a4dc to 6c14a27 Compare November 3, 2025 18:25
@Hijanhv
Copy link
Author

Hijanhv commented Nov 3, 2025

refactor: improve code readability with more descriptive naming (#133)

  • Replaced abbreviated variables/functions with descriptive ones
  • Unified naming for Kubernetes resource constants
  • Improved clarity in API and route handlers
  • Enhanced frontend naming conventions and dialog logic
  • Added kubeflow.d.ts for shared type definitions
  • Updated tsconfig paths and workflows for consistency

@LogicalGuy77
Copy link
Contributor

hi thanks for PR, please run prettier formatting and python black for linting so there are no effects in files which have no changes

@Hijanhv
Copy link
Author

Hijanhv commented Nov 4, 2025

hi thanks for PR, please run prettier formatting and python black for linting so there are no effects in files which have no changes
βœ… Ran Prettier and Black using pre-commit; all files are clean and formatted.

@Hijanhv
Copy link
Author

Hijanhv commented Nov 4, 2025

hi thanks for PR, please run prettier formatting and python black for linting so there are no effects in files which have no changes
ran black and prettier , no unnessary whitespaces were found

@juliusvonkohout
Copy link
Contributor

Oh I like that PR :-)

@juliusvonkohout
Copy link
Contributor

Please ping me if its good to merge @LogicalGuy77

@Hijanhv
Copy link
Author

Hijanhv commented Nov 4, 2025

Oh I like that PR :-)

thanks , but there seems to be issue .Hey, I ran the frontend tests (npm run test:prod -- --browsers=ChromeHeadless --watch=false) and they all failed with

TypeError: Cannot redefine property: location

Looks like the test setup is trying to mock or redefine window.location, which isn’t allowed in ChromeHeadless.
Is this something I should fix locally (like using a different test runner or disabling that mock), or is it an upstream issue with the test bootstrap that needs a patch on the repo side?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need a type file for kubeflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

same reason, common lib already has kubeflow types defined

@LogicalGuy77
Copy link
Contributor

LogicalGuy77 commented Nov 4, 2025

Hey, Glanced over your PR.
Only name-related fields should be in full form; I don’t think there should be other changes.

Also, I’d suggest making changes in smaller batches rather than pushing so many updates at once, large diffs like this can easily break parts of the app and make tests fail. Keep up the good work!

@juliusvonkohout
Copy link
Contributor

juliusvonkohout commented Nov 5, 2025

Hey, Glanced over your PR. Only name-related fields should be in full form; I don’t think there should be other changes.

Hello and thank you for the review. Regarding one point I disagree strongly. Also internal variable should be long pronounceable and expressive. "cfg" is wrong, "configuration" is right. Long pronounceable and expressive variable names and being able to write code as English text separates junior from senior engineers in hiring interviews. There are endless sources about the reasoning behind this. But it is definitively true.

So the idea from the first post is in general right:

  • Replaced abbreviated variables with full descriptive names:
    • cfg β†’ configuration
    • svc β†’ inference_service
    • gvk β†’ group_version_kind
    • FILE_ABS_PATH β†’ ABSOLUTE_FILE_PATH
  • Renamed helper functions:
    • inference_service_gvk() β†’ inference_service_group_version_kind()
    • _get_k8s_object() β†’ _get_kubernetes_object()
  • Unified constant naming:
    • K8S_* β†’ KUBERNETES_*
  • Added clearer docstrings and improved code comments.

@LogicalGuy77
Copy link
Contributor

@juliusvonkohout makes sense, I meant that tsconfig file should not be effected by these changes, besides that this looks great, I will run this locally and test it out., should be good to go then

@Hijanhv
Copy link
Author

Hijanhv commented Nov 6, 2025

What changes shall I do now @LogicalGuy77 @juliusvonkohout
The issue lies in the test setup where window.location is being mocked or redefined. ChromeHeadless treats window.location as a read-only property, so attempting to overwrite it throws TypeError: Cannot redefine property: location.

@juliusvonkohout
Copy link
Contributor

What changes shall I do now @LogicalGuy77 @juliusvonkohout The issue lies in the test setup where window.location is being mocked or redefined. ChromeHeadless treats window.location as a read-only property, so attempting to overwrite it throws TypeError: Cannot redefine property: location.

we can first merge what works and is clarified and then you can raise a follow up PR for the remaining changes.

@Hijanhv
Copy link
Author

Hijanhv commented Nov 13, 2025

hi i removed the others changes and kept only these
Replaced abbreviated variables with full descriptive names:
cfg β†’ configuration
svc β†’ inference_service
gvk β†’ group_version_kind
FILE_ABS_PATH β†’ ABSOLUTE_FILE_PATH
Renamed helper functions:
inference_service_gvk() β†’ inference_service_group_version_kind()
get_k8s_object() β†’ get_kubernetes_object()
Unified constant naming:
K8S
* β†’ KUBERNETES
*
Added clearer docstrings and improved code comments.

@LogicalGuy77
Copy link
Contributor

Thank you, this looks a lot cleaner. Can you sign off your commit?

@Hijanhv Hijanhv closed this by deleting the head repository Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Code Readability with More Descriptive Naming Body

3 participants