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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature Notification per Connection #10999

Closed
wants to merge 10 commits into from

Conversation

marcosmarxm
Copy link
Member

@marcosmarxm marcosmarxm commented Mar 9, 2022

What

This PR implements the notification per connection.
Closes #8037

How

Following the TechSpec.
Adding new API endpoints to create/update/remove notification configurations and notification/connection links.
Also changing the current behavior of the workspace notification level to continue working with the new feature.

Current Status

  • Change the current notification from Notification to NotificationLegacy (sorry this helps me changing easily the code in the future to adopt new workflow to older one too)
  • Change JobNotifier and airbyte/notification to use NotificationLegacy.
  • Create tables in the database, for this read file V0_35_50_001__AddNotificationTable.java the name file I'll update in the future.
  • Adding new endpoint and components in the API airbyte-api/src/main/openapi/config.yaml and all files inside airbyte-config
  • Create new functions to handle the endpoint actions WorkspaceHandler.java

What is WIP:

  • Adding update and delete endpoint.
  • Change functions from WorkspaceHandler to a new NotificationHandler to improve readability and domain.
  • Update JobNotifier to execute new workflow using the new notification feature.
  • Add workflow when creating a defaultNotification.
  • Made Migration to transfer legacy notification to new method.
  • Update documentation

馃毃 User Impact 馃毃

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 馃毃馃毃 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/server labels Mar 9, 2022
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 9, 2022 23:50 Inactive
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 9, 2022 23:50 Inactive
@github-actions github-actions bot added area/scheduler CDK Connector Development Kit labels Mar 18, 2022
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 18, 2022 17:53 Inactive
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 18, 2022 17:53 Inactive
@github-actions github-actions bot removed the CDK Connector Development Kit label Mar 18, 2022
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 18, 2022 20:00 Inactive
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 18, 2022 20:00 Inactive
@github-actions github-actions bot added the area/connectors Connector related issues label Mar 18, 2022
@github-actions github-actions bot removed the area/connectors Connector related issues label Mar 18, 2022
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 18, 2022 20:20 Inactive
@marcosmarxm marcosmarxm temporarily deployed to more-secrets March 18, 2022 20:20 Inactive
@marcosmarxm marcosmarxm marked this pull request as ready for review March 18, 2022 20:29
Copy link
Contributor

@terencecho terencecho left a comment

Choose a reason for hiding this comment

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

Looks like we should have a discussion next week regarding if requiring webhooks is the right move or not

required:
- workspaceId
- name
- webhookUrl
Copy link
Contributor

Choose a reason for hiding this comment

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

This webhookUrl requirement seems to be only a requirement if the notificationType is slack, or anything else that uses a webhook. For example, it shouldn't be required if we add a notification that utilizes customer.io for emails.

Copy link
Member Author

Choose a reason for hiding this comment

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

@terencecho what do you think remove webhookUrl and add a config which stores the config for Slack or other notification system?

@@ -9,11 +9,8 @@
import com.google.common.collect.ImmutableMap.Builder;
import io.airbyte.analytics.TrackingClient;
import io.airbyte.commons.map.MoreMaps;
import io.airbyte.config.Notification;
import io.airbyte.config.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
import io.airbyte.config.*;
import io.airbyte.config.NotificationLegacy;;

@@ -14,14 +14,9 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import io.airbyte.analytics.TrackingClient;
import io.airbyte.config.JobConfig;
import io.airbyte.config.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
import io.airbyte.config.*;
import io.airbyte.config.NotificationLegacy;;

type: object
required:
- workspaceId
- name
- webhookUrl
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above, regarding if we should be requiring webhooks for configs

.set(NOTIFICATION_CONFIG.ID, Notification.getNotificationId())
.set(NOTIFICATION_CONFIG.WORKSPACE_ID, Notification.getWorkspaceId())
.set(NOTIFICATION_CONFIG.NAME, Notification.getName())
.set(NOTIFICATION_CONFIG.WEBHOOK_URL, Notification.getWebhookUrl())
Copy link
Contributor

Choose a reason for hiding this comment

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

if we don't require webhooks, we'd need to add in something more specific similar to the current SlackNotificationConfig. Not the nicest solution since it embeds another config into this config, but would add flexibility in adding required information for new Notification_types

.withTombstone(false);
}

private NotificationLegacy generateNotification() {
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about naming this generateNotificationLegacy since it's referred to legacy everywhere else. And making generateNotificationNew -> generateNotification

@ameyabapat-bsft
Copy link

ameyabapat-bsft commented Apr 4, 2022

Hi @marcosmarxm,
Just a spot check, when are you guys planning to release this PR?

@CLAassistant
Copy link

CLAassistant commented May 5, 2022

CLA assistant check
All committers have signed the CLA.

@marcosmarxm marcosmarxm deleted the marcos/notification-per-connection branch June 24, 2022 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/scheduler area/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notification Preferences per Connection
4 participants