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

fix: posts and pages cannot be counted for visits #3471

Merged
merged 4 commits into from Mar 8, 2023

Conversation

guqing
Copy link
Member

@guqing guqing commented Mar 7, 2023

What type of PR is this?

/kind bug
/area core
/milestone 2.3.x

What this PR does / why we need it:

修复文章和自定义页面缺失 name 模型属性导致的访问量无法计数问题
此为 2.3.0 引入的问题 see #3300

how to test it?

  1. 切换文章的路由为不带 name 的规则
  2. 访问文章看 /apis/api.halo.run/v1alpha1/trackers/counter API 是否有如下参数,且 name 值正确
{
    "group": "content.halo.run",
    "plural": "posts",
    "name": "335",
    "hostname": "localhost",
    "screen": "1920x1080",
    "language": "zh-CN",
    "url": "/?p=halo-150-released",
    "referrer": "http://localhost:8090/?p=how-to-development-a-halo-plugin"
}
  1. 观察文章访问量是否有增加
  2. 重复上述 2、3 步骤检查自定义页面的访问量功能是否正确

Which issue(s) this PR fixes:

Fixes #3448

Does this PR introduce a user-facing change?

修复文章和自定义页面缺失属性导致的访问量无法计数问题

@f2c-ci-robot f2c-ci-robot bot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 7, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.3.x milestone Mar 7, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Mar 7, 2023
@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Merging #3471 (9719a7c) into main (633c489) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #3471      +/-   ##
============================================
+ Coverage     61.46%   61.58%   +0.11%     
- Complexity     2477     2479       +2     
============================================
  Files           393      393              
  Lines         12570    12572       +2     
  Branches       1019     1019              
============================================
+ Hits           7726     7742      +16     
+ Misses         4355     4342      -13     
+ Partials        489      488       -1     
Impacted Files Coverage Δ
...ava/run/halo/app/theme/router/SinglePageRoute.java 56.86% <100.00%> (+30.86%) ⬆️
...o/app/theme/router/factories/PostRouteFactory.java 55.67% <100.00%> (+0.46%) ⬆️
.../app/core/extension/attachment/PolicyTemplate.java 0.00% <0.00%> (-14.29%) ⬇️
...java/run/halo/app/extension/gc/GcSynchronizer.java 83.33% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ruibaby ruibaby changed the title fix: did not fill the name to view model for post and page route fix: posts and pages cannot be counted for visits Mar 7, 2023
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/approve

image

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2023
@ruibaby ruibaby requested review from JohnNiang and LIlGG March 8, 2023 02:48
@ruibaby ruibaby modified the milestones: 2.3.x, 2.4.x Mar 8, 2023
@ruibaby
Copy link
Member

ruibaby commented Mar 8, 2023

/cherry-pick release-2.3

@halo-dev-bot
Copy link
Collaborator

@ruibaby: once the present PR merges, I will cherry-pick it on top of release-2.3 in a new PR and assign it to you.

In response to this:

/cherry-pick release-2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

It works very well.

image

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Mar 8, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 8, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang, ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit ce9c33c into halo-dev:main Mar 8, 2023
5 checks passed
@halo-dev-bot
Copy link
Collaborator

@ruibaby: new pull request created: #3487

In response to this:

/cherry-pick release-2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

f2c-ci-robot bot pushed a commit that referenced this pull request Mar 8, 2023
This is an automated cherry-pick of #3471

/assign ruibaby

```release-note
修复文章和自定义页面缺失属性导致的访问量无法计数问题
```
@guqing guqing deleted the bugfix/3448 branch March 8, 2023 09:31
@ruibaby ruibaby modified the milestones: 2.4.x, 2.4.0 Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

文章访问次数统计不更新
4 participants