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

Upstream sync #11

Merged
merged 234 commits into from
Jul 12, 2024
Merged

Upstream sync #11

merged 234 commits into from
Jul 12, 2024

Conversation

mvcninja
Copy link

Sync upstream

aws-toolkit-automation and others added 30 commits June 4, 2024 12:31
Problem:
husky prints warning during "npm install":

    > root@0.0.1 prepare
    > ts-node ./scripts/prepare.ts
    install command is deprecated

Solution:
Migrate as described in https://github.com/typicode/husky/releases/tag/v9.0.1
- Notification are not displayed if user is logged in and has an active connection
- Notifications are only displayed once.

display Auth Notification...
- When a user closes the Amazon Q chat panel and
- User has not performed any auth action

display Error Notification...
- When a user closes the Amazon Q chat panel and
- A user performs auth Action though is not logged it.
Assumption: User in this scenario might not necessarily be in error state.
linyuxi0511 and others added 27 commits July 11, 2024 14:31
Problem:
- Currently, there is no information shown to customers in the chat regarding the number of iterations they could run during code generation.
- They only get to know this on hitting the iteration limits and seeing the error like you have reached the limit for number of iterations.

Solution:
- Hence, with this change, we are showing the remaining iterations proactively by exposing the remaining iteration numbers and total iteration numbers to the end of each code generation.
* feat: Add codecov to integ/e2e/linux tests

Problem:
- We don't have code coverage reporting for our integ/e2e/linux tests

Solution:
- Add it
Problem:

A recent refactor did not update certain static paths which prevent
webviews from working.

Solution:

Fix the incorrect paths.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
…s#5256)

Problem:
- app composers generate suggestions became unclickable when we switched back to seperate auth since they were relying on auth session sharing

Solution:
- allow extensions to call into auth/chat for amazon q. This allows toolkit to have features that depend on q auth without exposing all of auth itself
fix: font color for high contrast themes
Problem:
We have a settings.ts module which abstracts the vscode settings
interface, to gain important features such as type-checking, validation,
and error handling.
https://github.com/aws/aws-toolkit-vscode/blob/b9d5534c0879382baa5c900d14d0a2c3fdd529c5/packages/core/src/shared/settings.ts

The vscode globalState interface is very similar to the vscode settings
interface, and has the same limitations and potential for bugs: the data
is user-defined and arbitrary, thus the types are unknown and must
always be runtime-checked, which is a verbose and often overlooked step.

Examples:

- `redshiftState.ts` https://github.com/aws/aws-toolkit-vscode-staging/pull/1034/files
- https://github.com/aws/aws-toolkit-vscode/blob/8f55e40cab47ef7d25ed5faac274c3fac3f9f91c/src/shared/filesystemUtilities.ts#L228-L253
- globalState type issues related to a codewhisperer bug: aws#3060
- `aws.lastUploadedToS3Folder` https://github.com/aws/aws-toolkit-vscode/pull/3183/files
- `ExtensionUse` class https://github.com/aws/aws-toolkit-vscode/pull/3634/files
- `codewhisperer/util/globalStateUtil.test.ts` https://github.com/aws/aws-toolkit-vscode/blob/80e715bbf3e6eb354a9b6e5e327c732b89df38e3/packages/amazonq/test/unit/codewhisperer/util/globalStateUtil.test.ts

Solution:
- Introduce a `globalState` wrapper, similar to `src/shared/settings.ts`.
- Migrate the `redshiftState.ts` module into the centralized `globalState`
  module.
## Problem
There are 2 minor visual bugs in Amazon Q Chat UI:
* When the prompt input text exceeds the width of the chat box it's not always wrapped correctly.
* When user types empty spaces at the beginning of lines inside prompt, it appears like a code block instead of a paragraph.

## Solution
* Prompt input is properly sized and matches with the textarea underneath.
* Removed empty spaces for each line.

[MynahUI 4.15.2](https://github.com/aws/mynah-ui/releases/tag/v4.15.2)
Problem:

    [2024-07-12T13:58:12.874Z] ['info'] -> No token specified or token is empty
    ...
    [2024-07-12T13:58:13.715Z] ['verbose'] Passed token was 0 characters long
    [2024-07-12T13:58:13.952Z] ['verbose'] The error stack is: Error:
    Error uploading to https://codecov.io: Error: There was an error
    fetching the storage URL during POST: 429 - {'detail':
    ErrorDetail(string='Rate limit reached. Please upload with the
    Codecov repository upload token to resolve issue. Expected time to
    availability: 1752s.', code='throttled')}

Solution:
- Update codecov GHA runner.
- Set "token" field of the codecov GHA runner.
Problem:
javascript arrow functions allow braces `{ ... }` to surround an
expression without a `return`, which leads to bugs such as
aws#3659
aws#3662

Example:

    return supplementalContexts.filter(item => { item.content.trim().length !== 0 })

should be:

    return supplementalContexts.filter(item => item.content.trim().length !== 0)

Solution:
- Set prettier `arrowParens=always`. This is the default, explained
  here: https://prettier.io/docs/en/options.html#arrow-function-parentheses
  > At first glance, avoiding parentheses may look like a better choice
  because of less visual noise. However, when Prettier removes
  parentheses, it becomes harder to add type annotations, extra
  arguments or default values as well as making other changes.
  Consistent use of parentheses provides a better developer experience
  when editing real codebases, which justifies the default value for the
  option.
- Note: this is equivalent to the eslint `@stylistic/no-confusing-arrow` rule.
  - https://eslint.style/packages/default#stylistic-eslint-plugin
  - https://eslint.style/rules/default/no-confusing-arrow
This task was added as workaround. It's not need now because we have
"eslint-plugin-prettier" installed which tells eslint to include rules
decided by our prettier config.
Since our eslint rules now are informed by our prettier config
(performed by the "eslint-plugin-prettier" package), `prettier --write`
is unnecessary because it's implictly done by `eslint --fix`.

https://github.com/prettier/eslint-plugin-prettier
TODO: extract the eslint invocation to scripts/lint.ts so that it's not
duplicated in the "lintfix" task.
@mvcninja mvcninja merged commit 549afd2 into master Jul 12, 2024
8 checks passed
@mvcninja mvcninja deleted the upstream-sync branch July 12, 2024 17:50
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.