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][api]:Fix the issue of unset total page in pagination #15609

Closed
wants to merge 1 commit into from

Conversation

JohnZp
Copy link
Contributor

@JohnZp JohnZp commented Feb 22, 2024

Purpose of the pull request

fix #15606 about pagination
I would like to write about the issue of disk usage, but I am not sure if it can be met on different systems

    private static final File BASE_DIRECTORY = new File(".");
    public static long getDiskTotal() {
        return BASE_DIRECTORY.getTotalSpace();
    }

    public static long getDiskUsed() {
        return BASE_DIRECTORY.getUsableSpace();
    }

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@SbloodyS SbloodyS added bug Something isn't working 3.2.2 labels Feb 22, 2024
@SbloodyS SbloodyS added this to the 3.2.2 milestone Feb 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (5213290) 38.58% compared to head (7323f87) 38.56%.

❗ Current head 7323f87 differs from pull request most recent head 5927432. Consider uploading reports for the commit 5927432 to get more accurate results

Files Patch % Lines
...i/service/impl/AlertPluginInstanceServiceImpl.java 0.00% 2 Missing ⚠️
...api/service/impl/ProcessDefinitionServiceImpl.java 33.33% 2 Missing ⚠️
...heduler/api/service/impl/SchedulerServiceImpl.java 0.00% 2 Missing ⚠️
...er/api/service/impl/TaskDefinitionServiceImpl.java 33.33% 2 Missing ⚠️
...eduler/api/service/impl/DataSourceServiceImpl.java 0.00% 0 Missing and 1 partial ⚠️
...r/api/service/impl/ProcessInstanceServiceImpl.java 50.00% 1 Missing ⚠️
.../api/service/impl/ProjectParameterServiceImpl.java 0.00% 1 Missing ⚠️
...scheduler/api/service/impl/ProjectServiceImpl.java 50.00% 1 Missing ⚠️
...er/api/service/impl/TaskGroupQueueServiceImpl.java 50.00% 1 Missing ⚠️
...rg/apache/dolphinscheduler/api/utils/PageInfo.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev   #15609      +/-   ##
============================================
- Coverage     38.58%   38.56%   -0.02%     
- Complexity     4784     4785       +1     
============================================
  Files          1312     1312              
  Lines         44978    44953      -25     
  Branches       4819     4820       +1     
============================================
- Hits          17355    17338      -17     
+ Misses        25733    25723      -10     
- Partials       1890     1892       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Feb 22, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
68.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Comment on lines +68 to +75
public void setPaginationInfo(Integer total, List<T> totalList) {
setTotal(total);
setTotalList(totalList);
if (total != null && total > 0 && this.pageSize > 0) {
this.totalPage = (int) Math.ceil((double) total / this.pageSize);
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate on why you are doing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you elaborate on why you are doing this?

Cannot paginate, as described in issue #15606

Copy link
Member

Choose a reason for hiding this comment

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

I found there is a more elegent way in #15619. I would prefer merge it. @JohnZp

@Gallardot
Copy link
Member

Gallardot commented Feb 23, 2024

Oops. I just found out that someone was already working on it, and I created a PR #15619

@SbloodyS SbloodyS closed this Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.2 backend bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Version 3.2.1 [Instance list paging is incorrect, the monitored disk capacity is displayed as 0]
4 participants