Skip to content

Conversation

@ctlai95
Copy link
Contributor

@ctlai95 ctlai95 commented Jan 9, 2025

Problem

Code issues are grouped by severity and while this is useful in some cases, it can be hard to navigate.

Solution

Let the user decide how to group the issues.

Grouping strategies to start off with:

  • Severity (existing behavior)
  • File Location (issues in the same file are grouped together)
image image
  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ctlai95 ctlai95 marked this pull request as ready for review January 10, 2025 18:07
@ctlai95 ctlai95 requested review from a team as code owners January 10, 2025 18:07

it('should return fallback when stored state is invalid', function () {
const invalidStrategy = 'invalid'
sandbox.stub(globals.globalState, 'tryGet').returns(invalidStrategy)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just set the globalState? the tests have a fake globalState, it is safe to set it.

sinon and stubs aren't needed.

const tryGetStub = sandbox.stub(globals.globalState, 'tryGet').returns(undefined)
const result = state.getState()

sinon.assert.calledWith(tryGetStub, 'aws.amazonq.codescan.groupingStrategy', String)
Copy link
Contributor

Choose a reason for hiding this comment

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

these kinds of tests are very fragile. can you assert the actual state instead of using stubs/mocks?

})

it('should update state on selection', async function () {
const spy = sinon.spy(CodeIssueGroupingStrategyState.instance, 'setState')
Copy link
Contributor

@justinmk3 justinmk3 Jan 13, 2025

Choose a reason for hiding this comment

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

We use "singletons", which presumably are intended to make modules testable. Do we need to stub the global singleton, or can we create a new singleton "object" for testing?

If not, then there is zero reason to have singletons at all, we might as well use plain old modules.

@justinmk3 justinmk3 merged commit 062d24a into aws:master Jan 17, 2025
26 checks passed
karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
## Problem
Code issues are grouped by severity and while this is useful in some
cases, it can be hard to navigate.

## Solution
Let the user decide how to group the issues.
Grouping strategies to start off with:
- Severity (existing behavior)
- File Location (issues in the same file are grouped together)
kevluu-aws pushed a commit to kevluu-aws/aws-toolkit-vscode that referenced this pull request Jan 23, 2025
## Problem
Code issues are grouped by severity and while this is useful in some
cases, it can be hard to navigate.

## Solution
Let the user decide how to group the issues.
Grouping strategies to start off with:
- Severity (existing behavior)
- File Location (issues in the same file are grouped together)
chungjac pushed a commit to chungjac/aws-toolkit-vscode that referenced this pull request Jan 24, 2025
## Problem
Code issues are grouped by severity and while this is useful in some
cases, it can be hard to navigate.

## Solution
Let the user decide how to group the issues.
Grouping strategies to start off with:
- Severity (existing behavior)
- File Location (issues in the same file are grouped together)
s7ab059789 pushed a commit to s7ab059789/aws-toolkit-vscode that referenced this pull request Feb 19, 2025
## Problem
Code issues are grouped by severity and while this is useful in some
cases, it can be hard to navigate.

## Solution
Let the user decide how to group the issues.
Grouping strategies to start off with:
- Severity (existing behavior)
- File Location (issues in the same file are grouped together)
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