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

Display startup and emergency notifications #5143

Merged
merged 57 commits into from
Nov 29, 2024
Merged

Conversation

samgst-amazon
Copy link
Contributor

@samgst-amazon samgst-amazon commented Nov 29, 2024

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Display in-IDE notifications

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

…ifications(#5097)

* Display toast notifications with actions

* Condition matcher for displaying notifications

* Show notification banner

* feedback 1

* Modified deserialization cases and added tests

* not required file change

* feedback 1

* feedback 1

* modified the base class

* merge conflicts resolved

* rearranged call site

* show notifications when panel is opened

* fixed tests

* detekt

* feedback

* convert panels into wrappers

* fixed test
* initial commit

* run on startup

* detekt

* move vals

* remote resource implementation

* comments

* detekt

* Validate file before saving

* cache path

* observer implementation

* deserialize notifs from file

* detekt

* remove unused interface

* internal class

* Fix observer

* etag singleton state component

* add telemetry

* atomicBoolean

* initialize once per IDE startup

* code scan

* Omit (Unit)

* specify etag storage location

* detekt

* fix detekt issues

* basic tests

* no star imports

* coroutine scope delay instead of thread.sleep

* feedback fixes

* test fix

* Application Exists for tests

* endpoint object

* detekt

* detekt fixes

* boolean flag

* boolean flag

* update tests

* move startup flag handling to processBase

* fix delay

* fix delay

* Notification dismissal state tracking  (#5129)

* split notifications into separated lists.

* add persistent notification dismissal state logic

* boolean changes

* group persistant states

* comments

* Service initialized automatically

* isStartup global

* Deserialized notification schedule type

* tests

* persistent state syntax

* convert to light services

* Remove state from companion object

* detekt

* endpoint as registryKey

* detekt

* fix startup issues

* Expiry issues
* add logs for polling and processing notifs

* redundant

* finish log
@samgst-amazon samgst-amazon requested review from a team as code owners November 29, 2024 19:03
@samgst-amazon samgst-amazon merged commit 1a5f1c9 into main Nov 29, 2024
14 of 27 checks passed
Copy link

Qodana Community for JVM

12 new problems were found

Inspection name Severity Problems
Usage of redundant or deprecated syntax or deprecated symbols 🔶 Warning 3
Unused symbol 🔶 Warning 3
Possibly blocking call in non-blocking context 🔶 Warning 1
Redundant modality modifier 🔶 Warning 1
Class member can have 'private' visibility ◽️ Notice 4

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

import software.aws.toolkits.telemetry.FeatureId
import javax.swing.JComponent

class OuterAmazonQPanel(val project: Project) : BorderLayoutPanel() {

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Class "OuterAmazonQPanel" is never used
updateQPanel(component)
}

fun updateQPanel(content: JComponent) {

Check notice

Code scanning / QDJVMC

Class member can have 'private' visibility Note

Function 'updateQPanel' could be private

package software.aws.toolkits.jetbrains.core.notifications

object DisplayToastNotifications

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Object "DisplayToastNotifications" is never used
import software.aws.toolkits.jetbrains.core.DefaultRemoteResourceResolverProvider
import software.aws.toolkits.jetbrains.core.RemoteResourceResolverProvider
import software.aws.toolkits.telemetry.Component
import software.aws.toolkits.telemetry.ToolkitTelemetry

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

Remove deprecated symbol import
import software.aws.toolkits.jetbrains.core.DefaultRemoteResourceResolverProvider
import software.aws.toolkits.jetbrains.core.RemoteResourceResolverProvider
import software.aws.toolkits.telemetry.Component
import software.aws.toolkits.telemetry.ToolkitTelemetry

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'ToolkitTelemetry' is deprecated. Use type-safe metric builders
}

private fun emitFailureMetric(e: Exception?) {
ToolkitTelemetry.showNotification(

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'ToolkitTelemetry' is deprecated. Use type-safe metric builders
notifyStickyWithData(notifyType, title, message, null, action, notificationId)
}

fun notifyListenerForNotification(bannerContent: BannerContent) =

Check notice

Code scanning / QDJVMC

Class member can have 'private' visibility Note

Function 'notifyListenerForNotification' could be private
return shouldShow
}

fun matchesAllRules(notificationConditions: NotificationDisplayCondition, project: Project): Boolean {

Check notice

Code scanning / QDJVMC

Class member can have 'private' visibility Note

Function 'matchesAllRules' could be private
import software.aws.toolkits.jetbrains.utils.isTookitConnected
import javax.swing.JComponent

class OuterToolkitPanel(val project: Project) : BorderLayoutPanel() {

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Class "OuterToolkitPanel" is never used
updateToolkitPanel(component)
}

fun updateToolkitPanel(content: JComponent) {

Check notice

Code scanning / QDJVMC

Class member can have 'private' visibility Note

Function 'updateToolkitPanel' could be private
samgst-amazon added a commit that referenced this pull request Dec 2, 2024
samgst-amazon added a commit that referenced this pull request Dec 2, 2024
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.

4 participants