Skip to content

feat: add timestamp list field for airship - #1962

Merged
maheshkutty merged 7 commits into
developfrom
feat.airship_timestamp_field
Mar 26, 2025
Merged

maheshkutty merged 7 commits into
developfrom
feat.airship_timestamp_field

Conversation

@maheshkutty

@maheshkutty maheshkutty commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Add a list field to take attributes that are marked as a timestamp for airship

What is the related Linear task?

Resolves INT-3423

Screenshot

image

N/A

Any new dependencies introduced with this change?

N/A

Any new checks got introduced or modified in test suites. Please explain the changes.

N/A


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • I have executed schemaGenerator tests and updated schema if needed

  • Are sensitive fields marked as secret in definition config?

  • My test cases and placeholders use only masked/sample values for sensitive fields

  • Is the PR limited to 10 file changes & one task?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

Summary by CodeRabbit

  • New Features

    • Expanded the destination settings to include a configurable timestamp attribute.
    • Introduced a new dynamic custom form in the user interface that allows users to input timestamp attributes with built-in validation and guidance.
    • Enhanced the configuration schema to enforce the presence of certain keys and define new structures for data validation.
  • Bug Fixes

    • Updated validation criteria to ensure that timestampAttributes is correctly recognized as an array in relevant configurations.

@coderabbitai

coderabbitai Bot commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request updates configuration files for the Airship destination. The database configuration now includes an additional "timestampAttributes" field in the defaultConfig array. The UI configuration is enhanced by introducing a new dynamic custom form to capture timestamp attributes, complete with custom fields and validation rules. Additionally, the schema has been modified to enforce new properties and validation criteria, while validation tests have been updated to reflect these changes.

Changes

Files Change Summary
src/.../airship/db-config.json Added "timestampAttributes" to the defaultConfig array in the destConfig object.
src/.../airship/ui-config.json Added a new dynamic custom form entry for timestamp attributes, including custom fields with a regex for input validation and a footer note.
src/.../airship/schema.json Introduced new properties: apiKey, appKey, timestampAttributes, and dataCenter, along with modifications to additionalProperties.
test/.../airship.json Added new fields for apiKey, appKey, and dataCenter, modified timestampAttributes, and updated error messages.

Possibly related PRs

Suggested reviewers

  • lvrach
  • am6010
  • krishna2020
  • ssbeefeater
  • debanjan97
  • cisse21
  • 1abhishekpandey
  • sandeepdsvs
  • ItsSudip
  • yashasvibajpai

Poem

I'm a rabbit, hopping through code so light,
Timestamp attributes now join our flight.
Dynamic forms bloom in our config land,
Each new entry crafted just as planned.
With every byte I dance and sing,
Celebrating changes like spring in full swing!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7c4018 and d5f5e35.

📒 Files selected for processing (1)
  • src/configurations/destinations/airship/ui-config.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/configurations/destinations/airship/ui-config.json

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov

codecov Bot commented Mar 25, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3589231) to head (d5f5e35).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop     #1962   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           53        53           
  Branches         7         7           
=========================================
  Hits            53        53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/configurations/destinations/airship/ui-config.json (1)

26-40: Dynamic Custom Form for Timestamp Attributes is Configured Correctly.

The new dynamic custom form section for timestamp attributes is structured consistently with existing form components. The regex allows flexibility (supporting template strings, environment variables, or up to 100 characters), which meets the PR requirements. As a minor nitpick, consider revising the footerNote for clarity (e.g., "Enter the timestamp attributes" instead of "Enter the attributes that are timestamp value") to improve user readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3589231 and 7eeaa4d.

📒 Files selected for processing (2)
  • src/configurations/destinations/airship/db-config.json (1 hunks)
  • src/configurations/destinations/airship/ui-config.json (1 hunks)
🔇 Additional comments (1)
src/configurations/destinations/airship/db-config.json (1)

38-39: Addition of "timestampAttributes" in defaultConfig is well-aligned.

By including "timestampAttributes" in the defaultConfig array, the configuration now supports timestamp handling as intended by the PR objectives. Please ensure that any processing logic downstream correctly handles this new field.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/data/validation/destinations/airship.json (1)

4-14: Validating New Fields in First Configuration Object
The new fields—apiKey, appKey, dataCenter, and timestampAttributes—are introduced as intended. The timestampAttributes field is correctly set up as an array of objects, each containing a timestampAttribute property.

Consider adding tests for edge cases (e.g., an empty timestampAttributes array) to further validate the configuration’s behavior.

src/configurations/destinations/airship/schema.json (1)

5-30: Introducing New Schema Properties for Airship Integration
The schema now includes four new properties:

  • apiKey (required): Enforced as a string with the provided regex pattern.
  • appKey: Defined similarly as a string with an appropriate pattern.
  • timestampAttributes: Expected to be an array of objects; however, note that each item only specifies a properties block without a "required" list. If every item must contain the timestampAttribute field, consider adding a required field within the item definition.
  • dataCenter: Defined as a boolean with a default value of false.

Overall, these additions properly extend the configuration, and allowing additionalProperties remains acceptable for flexibility.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7eeaa4d and c7c4018.

📒 Files selected for processing (2)
  • src/configurations/destinations/airship/schema.json (2 hunks)
  • test/data/validation/destinations/airship.json (3 hunks)
🔇 Additional comments (3)
test/data/validation/destinations/airship.json (2)

142-143: Ensuring Proper Type Enforcement in Second Configuration Object
In this configuration, timestampAttributes is provided as a string rather than an array. This change is intentional to exercise the negative validation path, as evidenced by the error message "timestampAttributes must be array". Similarly, the error messages for oneTrustCookieCategories and ketchConsentPurposes correctly indicate type mismatches.

Please double-check that these negative test cases cover all expected improper configurations based on the new schema.

Also applies to: 162-166


170-170: Consistent Credential Field Addition in Third Configuration Object
The inclusion of the apiKey field in the third configuration object ensures consistency with the schema requirements.

src/configurations/destinations/airship/schema.json (1)

816-818: Schema Flexibility with additionalProperties
The setting "additionalProperties": true retains flexibility by allowing unspecified keys in the configuration objects. Ensure that this behavior is well documented and aligns with the integration’s design requirements.

@maheshkutty
maheshkutty merged commit c95e740 into develop Mar 26, 2025
@maheshkutty
maheshkutty deleted the feat.airship_timestamp_field branch March 26, 2025 06:30
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.

3 participants