Skip to content

chore: added dates in issue export#6088

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
chore/issue-exporter-dates
Nov 22, 2024
Merged

chore: added dates in issue export#6088
sriramveeraghanta merged 2 commits intopreviewfrom
chore/issue-exporter-dates

Conversation

@NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Nov 22, 2024

chore:

  • added start date and target date in xlsx and json.

Summary by CodeRabbit

  • New Features
    • Updated the handling of "Start Date" and "Target Date" fields in CSV and JSON export formats for improved date representation.
    • Enhanced the output format for better clarity and usability.
    • Adjusted the structure of the "Created By" and "Assignee" fields for improved readability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 22, 2024

Walkthrough

The changes in this pull request involve modifications to the generate_table_row and generate_json_row functions within the apiserver/plane/bgtasks/export_task.py file. The handling of the start_date and target_date fields has been updated from dateTimeConverter to dateConverter, altering their format in the output. Additionally, minor adjustments were made to the conditional expressions for the "Created By" and "Assignee" fields for improved readability. The overall structure and logic of the functions remain unchanged.

Changes

File Path Change Summary
apiserver/plane/bgtasks/export_task.py - Updated generate_table_row to use dateConverter for start_date and target_date.
- Modified generate_json_row to include start_date and target_date as key-value pairs using dateConverter.
- Adjusted conditional expressions for "Created By" and "Assignee" fields for readability.

Possibly related PRs

  • [WEB-2430] fix: issue exports for project #5579: The changes in this PR also modify functions within the export_task.py file, specifically related to the handling of assignees, which is relevant to the changes made in the generate_table_row and generate_json_row functions in the main PR.
  • fix: export for analytics and issues #5815: This PR includes changes to the export_task.py file, which may relate to the overall export functionality, aligning with the modifications made in the main PR regarding date handling in export tasks.

Suggested labels

⚙️backend

Suggested reviewers

  • pablohashescobar
  • sriramveeraghanta

🐇 In the fields where data flows,
New dates bloom, as knowledge grows.
Start and target, side by side,
In exports now, they take their stride.
With each row, a story to tell,
In CSV and JSON, all is well! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f3ff80a and 5104234.

📒 Files selected for processing (1)
  • apiserver/plane/bgtasks/export_task.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apiserver/plane/bgtasks/export_task.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 resolve resolve all the CodeRabbit review comments.
  • @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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 86f8743 and f3ff80a.

📒 Files selected for processing (1)
  • apiserver/plane/bgtasks/export_task.py (2 hunks)
🔇 Additional comments (1)
apiserver/plane/bgtasks/export_task.py (1)

159-160: Verify date field handling across all export formats

Let's ensure the new date fields are properly handled across all export formats (CSV, JSON, XLSX) and that they are being correctly queried from the database.

Also applies to: 195-196

✅ Verification successful

Let me gather more information about the database query and field handling.


Let me check one final aspect about the header definitions and field mappings.


Date fields are properly handled across all export formats

Based on the verification results:

  • The fields are correctly included in the database query's values() call
  • Both start_date and target_date are properly defined in the Issue model as DateField
  • The export header definitions include these fields
  • Date formatting is consistently handled through dateTimeConverter for all formats
  • The fields are properly processed in both table rows (generate_table_row) and JSON rows (generate_json_row)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify date field handling across the codebase

# Check if the fields are properly queried in the values() call
rg -A 5 "values\(" apiserver/plane/bgtasks/export_task.py

# Check for any other date formatting patterns in the codebase
rg "dateTimeConverter|dateConverter" --type py

# Check for any other export-related functions that might need updates
rg "generate_.*_row|create_.*_file" --type py

Length of output: 4017


Script:

#!/bin/bash
# Check the full query and field selection in export_task.py
rg -B 10 -A 10 "\.values\(" apiserver/plane/bgtasks/export_task.py

# Check the header definitions to ensure fields are included
rg "header.*=|ISSUE_HEADERS" apiserver/plane/bgtasks/export_task.py

Length of output: 1092


Script:

#!/bin/bash
# Get the complete header definition and field mappings
rg -A 50 "header = \[" apiserver/plane/bgtasks/export_task.py

# Check if there are any date-related field definitions in the models
rg "start_date|target_date" apiserver/plane/db/models/

Length of output: 3836

@sriramveeraghanta sriramveeraghanta merged commit ca88675 into preview Nov 22, 2024
@sriramveeraghanta sriramveeraghanta deleted the chore/issue-exporter-dates branch November 22, 2024 14:29
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