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

[Core] Changed log level #1430

Merged
merged 1 commit into from
Feb 24, 2025
Merged

[Core] Changed log level #1430

merged 1 commit into from
Feb 24, 2025

Conversation

matan84
Copy link
Member

@matan84 matan84 commented Feb 24, 2025

User description

Description

What - changed log level

Why - Readability of the code

How - changed log level

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.


PR Type

Bug fix, Documentation


Description

  • Changed log level from exception to debug for better readability.

  • Updated CHANGELOG.md to reflect the log level change.

  • Incremented version in pyproject.toml to 0.20.3.


Changes walkthrough 📝

Relevant files
Bug fix
ocean.py
Adjusted log level for better error handling                         

port_ocean/ocean.py

  • Changed log level from exception to debug.
  • Improved logging for frequent errors.
  • +1/-1     
    Documentation
    CHANGELOG.md
    Updated changelog for version 0.20.3                                         

    CHANGELOG.md

  • Added entry for version 0.20.3.
  • Documented log level change under improvements.
  • +6/-0     
    Configuration changes
    pyproject.toml
    Updated project version to 0.20.3                                               

    pyproject.toml

    • Incremented version from 0.20.2 to 0.20.3.
    +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @matan84 matan84 requested a review from a team as a code owner February 24, 2025 15:03
    @matan84 matan84 merged commit 6cea7e4 into main Feb 24, 2025
    8 of 10 checks passed
    @matan84 matan84 deleted the change-log-level branch February 24, 2025 15:06
    Copy link
    Contributor

    Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Error Handling

    Changing log level from exception to debug for file access errors may hide important issues from administrators. Consider keeping exception level for file permission or corruption issues.

    logger.debug(
        "Failed to load external oauth access token from file",
        file_path=self.config.oauth_access_token_file_path,
    )

    Copy link
    Contributor

    Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Security
    Maintain visibility of auth failures

    Changing log level from 'exception' to 'debug' for OAuth token loading failures
    could hide important authentication issues. Consider keeping 'exception' level
    or using 'warning' to ensure visibility of potential security-related problems.

    port_ocean/ocean.py [136-143]

     try:
         with open(self.config.oauth_access_token_file_path, "r") as f:
             return f.read()
     except Exception:
    -    logger.debug(
    +    logger.warning(
             "Failed to load external oauth access token from file",
             file_path=self.config.oauth_access_token_file_path,
         )
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    __

    Why: The suggestion correctly identifies a security concern - reducing log level for authentication failures could hide important security issues. Using warning level instead of debug would maintain better visibility while still addressing the original goal of reducing log noise.

    Medium
    • More

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants