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

feat: add support for PATs, allow to select reference directory for delta scans [IDE-846] #577

Merged
merged 7 commits into from
Feb 12, 2025

Conversation

bastiandoetsch
Copy link
Contributor

@bastiandoetsch bastiandoetsch commented Feb 11, 2025

Description

feat: allow to define reference directory for delta, allow Snyk PATs

This change introduces the ability to select a reference directory for delta findings in addition to the existing option of selecting a reference branch. Let's break down the changes:

Key Changes & Improvements:

  • SNYK_SET_DELTA_REFERENCE_COMMAND replaces SNYK_SET_BASE_BRANCH_COMMAND: This makes the command more generic, reflecting its expanded functionality.
  • getReference() replaces getBaseBranch(): Again, for generality.
  • New referenceFolderPath in FolderConfig: Stores the path to the reference directory.
  • New setReferenceFolder() command and logic: Handles selecting and saving the reference directory.
  • QuickPick for Reference Selection: Users now choose between "Select a reference branch" and "Select a reference directory" before proceeding.
  • PAT Validation: Added a patValidate function to the AuthenticationService to properly validate Personal Access Tokens.
  • Mocking Improvements: Added showOpenDialog to the window mock for better testing.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

image
image

@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-846_add-command-to-set-reference-folder branch 2 times, most recently from aec2ad7 to 7b5dd1a Compare February 11, 2025 09:38
@bastiandoetsch bastiandoetsch changed the title feat: add support for PATs feat: add support for PATs, allow to select reference directory for delta scans [IDE-846] Feb 11, 2025
@bastiandoetsch bastiandoetsch marked this pull request as ready for review February 11, 2025 09:53
@bastiandoetsch bastiandoetsch requested a review from a team as a code owner February 11, 2025 09:53
…[IDE-46]

This change introduces the ability to select a reference *directory* for delta findings in addition to the existing option of selecting a reference *branch*.  Let's break down the changes and offer some suggestions:

**Key Changes & Improvements:**

* **`SNYK_SET_DELTA_REFERENCE_COMMAND` replaces `SNYK_SET_BASE_BRANCH_COMMAND`:** This makes the command more generic, reflecting its expanded functionality.
* **`getReference()` replaces `getBaseBranch()`:**  Again, for generality.
* **New `referenceFolderPath` in `FolderConfig`:** Stores the path to the reference directory.
* **New `setReferenceFolder()` command and logic:**  Handles selecting and saving the reference directory.
* **QuickPick for Reference Selection:** Users now choose between "Select a reference branch" and "Select a reference directory" before proceeding.
* **PAT Validation:** Added a `patValidate` function to the `AuthenticationService` to properly validate Personal Access Tokens.
* **Mocking Improvements:** Added `showOpenDialog` to the window mock for better testing.
This change adds spaces around the colon in the "Click here to choose reference" text displayed when delta findings are enabled.  The original text was `[ current:${reference} ]`, and the updated text is `[ current: ${reference} ]`.  This improves readability slightly.
…nto feat/IDE-846_add-command-to-set-reference-folder
@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-846_add-command-to-set-reference-folder branch from 86368f7 to d73c0ef Compare February 11, 2025 10:01
@bastiandoetsch bastiandoetsch enabled auto-merge (squash) February 11, 2025 10:24
Copy link
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

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

Approved!!

@bastiandoetsch bastiandoetsch merged commit 77ee3ea into main Feb 12, 2025
11 checks passed
@bastiandoetsch bastiandoetsch deleted the feat/IDE-846_add-command-to-set-reference-folder branch February 12, 2025 13:16
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.

2 participants