Skip to content
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

🚧Refactor function parameter names #84

Closed
7 tasks done
CalvinWilkinson opened this issue Sep 3, 2024 · 1 comment · Fixed by #94
Closed
7 tasks done

🚧Refactor function parameter names #84

CalvinWilkinson opened this issue Sep 3, 2024 · 1 comment · Fixed by #94
Assignees
Labels
🧨breaking-changes Feature/changes contains breaking changes low-priority Low Priority preview Done while in preview tech-debt Code refactoring or cleanup / tech debt reduction

Comments

@CalvinWilkinson
Copy link
Member

CalvinWilkinson commented Sep 3, 2024

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Refactor parameter names for various functions in the RepoClient class and sanitize incoming relative file paths:
This is to make the meaning of the parameters more clear, which in turn improves the API.

Do the following:

  1. Rename the branchName parameter to ref for the following functions in the RepoClient:
    • getFileContent
    • fileExists
    • getFileContentInternal
  2. Update the code docs for the parameters.
  3. Sanitize the relativeFilePath parameters by trimming any ., /, \, and ~ characters from the beginning of the paths.
    This ensures that using these common characters for paths does not cause issues with the URL's construction during the concatenation of the URL and the relative file path. Also, make sure that the URL's owner/repo/contents section and the relative file path are separated by a / character.
  4. Remove the check of absolute file paths from the functions. Refer to the check below.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

Preview Give feedback

ToDo Items

The items to complete to satisfy the Definition of Done.

Preview Give feedback

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking-changes
New Feature ✨new-feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@github-project-automation github-project-automation bot moved this to ⚪Not Set in KD-Team Sep 3, 2024
@CalvinWilkinson CalvinWilkinson self-assigned this Sep 3, 2024
@CalvinWilkinson CalvinWilkinson added low-priority Low Priority preview Done while in preview tech-debt Code refactoring or cleanup / tech debt reduction labels Sep 3, 2024
@CalvinWilkinson CalvinWilkinson moved this from ⚪Not Set to 🏗️In Development in KD-Team Sep 3, 2024
@CalvinWilkinson CalvinWilkinson added this to the v1.0.0-preview.14 milestone Sep 3, 2024
@CalvinWilkinson CalvinWilkinson added the 🍺hacktoberfest-medium Medium issue for mid-level developers for hacktoberfest!! Hack away!! label Sep 26, 2024
@CalvinWilkinson
Copy link
Member Author

Sanitation of the relative file path was fixed in the bug issue below:

CalvinWilkinson added a commit that referenced this issue Oct 14, 2024
@CalvinWilkinson CalvinWilkinson added 🧨breaking-changes Feature/changes contains breaking changes and removed 🍺hacktoberfest-medium Medium issue for mid-level developers for hacktoberfest!! Hack away!! labels Oct 14, 2024
CalvinWilkinson added a commit that referenced this issue Oct 14, 2024
* Start work for issue #84

* refactor!: rename the branchName param to ref for getFileContent func

* refactor!: refactor branchName param to ref param to fileExists func

* refactor: refactor param in private function
@github-project-automation github-project-automation bot moved this from 🏗️In Development to ✅Done in KD-Team Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧨breaking-changes Feature/changes contains breaking changes low-priority Low Priority preview Done while in preview tech-debt Code refactoring or cleanup / tech debt reduction
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant