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

🚧Fix GitHub token service issue #33

Closed
11 tasks done
CalvinWilkinson opened this issue Sep 28, 2022 · 2 comments · Fixed by #34
Closed
11 tasks done

🚧Fix GitHub token service issue #33

CalvinWilkinson opened this issue Sep 28, 2022 · 2 comments · Fixed by #34
Assignees
Labels
🧨breaking changes Feature/changes contains breaking changes 🐛bug Something isn't working high priority High Priority ✨new feature New feature that does not exist preview Done while in preview

Comments

@CalvinWilkinson
Copy link
Member

CalvinWilkinson commented Sep 28, 2022

Complete The Item Below

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

Description

Currently the GitHubTokenService is not working correctly. The token service uses the SecretService to load the GitHub token locally from disk when running locally. The issue is that the SecretService is looking in the wrong location.

How it is supposed to work:
It is supposed to look inside of the .github folder in the root of the repository. If the folder directory path exists, it should check for the local-secrets.json file and load the token from the file.

How it currently working:
It uses the .github folder as part of the path, but the section before the .github folder in the path is incorrect. It is building the beginning section of the path based on the execution path of the assembly. This is how it was originally designed, but the ⚽ was dropped and somebody forgot to update the service. (That somebody was "me". 😁

How To Fix It:
Instead of using the executable assembly, use the Directory.GetCurrentDirectory() instead to build the path section before the .github folder. This represents the root of the repository. The SecretService uses the ICurrentDirService to be able to get the executing assembly. This is only used in the SecretService class. Just delete the ICurrentDirService interface and CurrentDirService class entirely. It is not needed anymore.

Acceptance Criteria

  • Refactor the SecretService to build the path correctly.
  • SecretService unit tests updated
  • ICurrentDireService interface deleted
  • CurrentDireService class deleted

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct project (if applicable).
  • Issue linked to the correct milestone (if applicable).
  • Draft pull request created and linked to this issue (only required with code changes).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
Workflow Changes workflow
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.
@CalvinWilkinson CalvinWilkinson added high priority High Priority preview Done while in preview 🐛bug Something isn't working labels Sep 28, 2022
@CalvinWilkinson CalvinWilkinson added this to the v1.0.0-preview.6 milestone Sep 28, 2022
@CalvinWilkinson CalvinWilkinson self-assigned this Sep 28, 2022
CalvinWilkinson added a commit that referenced this issue Sep 28, 2022
@CalvinWilkinson CalvinWilkinson linked a pull request Sep 28, 2022 that will close this issue
12 tasks
@CalvinWilkinson CalvinWilkinson added the 🧨breaking changes Feature/changes contains breaking changes label Sep 29, 2022
@CalvinWilkinson
Copy link
Member Author

🧨breaking changes Feature/changes contains breaking changes introduced.

The BuildSettingsDirPath (CLI switch --build-settings-dir-path) had been renamed to WorkflowTemplateOutput (CLI switch --workflow-template-output)

@CalvinWilkinson CalvinWilkinson added the ✨new feature New feature that does not exist label Sep 29, 2022
@CalvinWilkinson
Copy link
Member Author

✨new feature New feature that does not exist introduced.

Added descriptions to all of the build parameters. These will show up in the CLI when using dotnet cicd --help

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 🐛bug Something isn't working high priority High Priority ✨new feature New feature that does not exist preview Done while in preview
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant