Skip to content

fix: handle created_at with diff types #491

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

Merged
merged 1 commit into from
Mar 14, 2025
Merged

Conversation

jmeridth
Copy link
Member

Fixes #489

We union dict and github3.search.IssueSearchResult types but their created at attributes are accessed differently.

issue["createdAt"] for dict

issue.issue.created_at for github3.search.IssueSearchResult

  • turned off HIDE_CREATED_AT on some tests to ensure we are handling that scenario

Pull Request

Proposed Changes

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance, or breaking

@jmeridth jmeridth self-assigned this Mar 14, 2025
@Copilot Copilot AI review requested due to automatic review settings March 14, 2025 12:53
@jmeridth jmeridth requested a review from a team as a code owner March 14, 2025 12:53
@github-actions github-actions bot added the fix label Mar 14, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the handling of the created_at attribute for two different issue types by applying conditional logic based on the type.

  • Updated markdown tests to include the created_at column in the output.
  • Added a new configuration key "HIDE_CREATED_AT" to control the display of created_at.
  • Modified issue metrics computation to differentiate between dict and github3.search.IssueSearchResult types using conditional logic.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test_markdown_writer.py Added created_at parameter in tests and updated markdown table.
test_config.py Added "HIDE_CREATED_AT" to the list of configuration keys.
issue_metrics.py Introduced conditional logic to handle created_at from different types.
test_issue_metrics.py Updated test dictionaries and config to support created_at handling.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@jmeridth jmeridth force-pushed the jm_fix_hide_created_at_false branch 3 times, most recently from d2eafd9 to 0f60776 Compare March 14, 2025 13:14
Fixes #489

We union dict and github3.search.IssueSearchResult types but their
created at attributes are accessed differently.

issue["createdAt"] for dict

issue.issue.created_at for github3.search.IssueSearchResult

- [x] turned off HIDE_CREATED_AT on some tests to ensure we are handling that scenario

Signed-off-by: jmeridth <[email protected]>
@jmeridth jmeridth force-pushed the jm_fix_hide_created_at_false branch from 0f60776 to be847c8 Compare March 14, 2025 13:18
@jmeridth jmeridth merged commit da328ef into main Mar 14, 2025
32 checks passed
@jmeridth jmeridth deleted the jm_fix_hide_created_at_false branch March 14, 2025 13:21
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.

HIDE_CREATED_AT not working when set to False
1 participant