Skip to content

Conversation

chlins
Copy link
Member

@chlins chlins commented Apr 24, 2025

This pull request simplifies the BaseModel struct in manager/models/models.go by removing redundant GORM tags from the CreatedAt and UpdatedAt fields.

Code simplification:

  • manager/models/models.go: Removed the gorm tags specifying column names, types, defaults, and comments for the CreatedAt and UpdatedAt fields in the BaseModel struct, leaving only the json tags.

Description

Related Issue

#3989

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

…t with gorm internal

Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins requested a review from a team as a code owner April 24, 2025 09:05
@chlins chlins requested review from imeoer, garenwen and BruceAko April 24, 2025 09:05
Copy link

@Liam-Zhao Liam-Zhao left a comment

Choose a reason for hiding this comment

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

LGTM

@Liam-Zhao Liam-Zhao enabled auto-merge (squash) April 24, 2025 09:07
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.39%. Comparing base (2d331fc) to head (290071c).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3990      +/-   ##
==========================================
- Coverage   34.40%   34.39%   -0.01%     
==========================================
  Files         341      341              
  Lines       40084    40084              
==========================================
- Hits        13789    13786       -3     
- Misses      25389    25391       +2     
- Partials      906      907       +1     
Flag Coverage Δ
unittests 34.39% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
manager/models/models.go 27.39% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Liam-Zhao Liam-Zhao merged commit 09d99d3 into main Apr 24, 2025
27 of 35 checks passed
@Liam-Zhao Liam-Zhao deleted the fix/base-model-timestamp branch April 24, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants