Skip to content

Conversation

@lihongong
Copy link
Contributor

Fixes #2429

Proposed commit message

Add since and until field in report-config.yaml under branches

Previously, the report-config.yaml doesn't support different time periods for 
different repos and relied on CLI flags for all repos.

Add two optional fields (since, until) with the format
- dd/MM/yyyy
- dd/MM/yyyy HH:mm
- dd/MM/yyyy HH:mm:ss

report-config.yaml input:
p report-config yaml ss

Portfolio Mode:
p main ss

Normal Mode:
main ss visible barrier
main ss header time ss

@github-actions github-actions bot requested a deployment to dashboard-2490 July 28, 2025 07:17 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 July 28, 2025 07:17 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2490 July 28, 2025 07:22 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 July 28, 2025 07:22 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2490 July 28, 2025 16:50 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 July 28, 2025 16:50 Abandoned
Accidentally commit changes to report-config.yaml when working with new
report-config feature.
Accidentally commit changes to report-config.yaml when working with new
report-config feature.
@github-actions github-actions bot requested a deployment to dashboard-2490 July 28, 2025 17:19 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 July 28, 2025 17:19 Abandoned
Accidentally commit changes to report-config.yaml when working with new
report-config feature.
@github-actions github-actions bot requested a deployment to dashboard-2490 July 28, 2025 17:20 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 July 28, 2025 17:20 Abandoned
@lihongong lihongong changed the title Branch diffirent time period report config yaml Allow diffirent time period for different repos in report-config.yaml Jul 28, 2025
@github-actions github-actions bot requested a deployment to dashboard-2490 July 29, 2025 14:35 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 July 29, 2025 14:35 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2490 August 27, 2025 16:52 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 August 27, 2025 16:52 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2490 August 27, 2025 17:04 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 August 27, 2025 17:04 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2490 August 27, 2025 17:19 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 August 27, 2025 17:19 Abandoned
@lihongong
Copy link
Contributor Author

lihongong commented Aug 27, 2025

Sorry for the late reply.

what happens when both CLI dates are provided but only one config date is set?

It will use the config date provided and fall back to the cli date for the other that isn't specified in the config file.
Example:
config: since = 1/2/2025
cli: since = 1/1/2025, until = 31/4/2025
effective: since = 1/2/2025, until = 31/4/2025
This behavior is handled in OneStopConfigRunConfiguration

@github-actions
Copy link
Contributor

Hi,
We are going to mark this PR as stale because it has been inactive for the past 30 days.
If no further activity occurs within the following 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 7 days and leave a comment to remove the stale label.
Do let us know if you are stuck so that we can help you!'

@github-actions github-actions bot requested a deployment to dashboard-2490 October 2, 2025 12:57 Abandoned
@github-actions github-actions bot requested a deployment to docs-2490 October 2, 2025 12:57 Abandoned
@CYX22222003 CYX22222003 changed the title Allow different time period for different repos in report-config.yaml [#2429] Allow different time period for different repos in report-config.yaml Oct 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

Hi,
We are going to mark this PR as stale because it has been inactive for the past 30 days.
If no further activity occurs within the following 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 7 days and leave a comment to remove the stale label.
Do let us know if you are stuck so that we can help you!'

@github-actions github-actions bot added the Stale label Nov 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

This PR was closed because it has been marked as stale for 7 days with no activity.
Feel free to reopen this PR if you would like to continue working on it.

Copy link
Contributor

@lyuanww lyuanww left a comment

Choose a reason for hiding this comment

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

@lihongong Sorry for the late review. The PR looks good overall—just a few small nits around documentation and tests before I can approve. Good work!

Comment on lines +231 to +239
* `since`: Start date of commits to include in the analysis. Accepted formats:
* Date only
* `dd/MM/yyyy`
* Date and time
* `dd/MM/yyyy HH:mm` or
* `dd/MM/yyyy HH:mm:ss`

* `until`: End date of commits to include in the analysis. Accepted formats:
* **same as the above**
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `since`: Start date of commits to include in the analysis. Accepted formats:
* Date only
* `dd/MM/yyyy`
* Date and time
* `dd/MM/yyyy HH:mm` or
* `dd/MM/yyyy HH:mm:ss`
* `until`: End date of commits to include in the analysis. Accepted formats:
* **same as the above**
* `since`: Start date of commits to include in the analysis. Accepted formats:
* Date format:
* `dd/MM/yyyy`
* Date and time formats:
* `dd/MM/yyyy HH:mm`
* `dd/MM/yyyy HH:mm:ss` (e.g., `05/12/2025 14:32:10`)
* `until`: End date of commits to include in the analysis. Accepted formats:
* Date format:
* `dd/MM/yyyy`
* Date and time formats:
* `dd/MM/yyyy HH:mm`
* `dd/MM/yyyy HH:mm:ss` (e.g., `05/12/2025 14:32:10`)

Perhaps this is clearer?

Comment on lines +242 to +252
Behavior When Both Report Config Dates & CLI Flags Are Provided:

- If `since` date is specified in both `report-config.yaml` and CLI, the **Config dates take precedence** for that repository. The same applies to `until` date.
- The Config date range must fall within the **CLI date boundaries**. If it exceeds, the program exits with an error.
- Example:
- CLI Date - Since: 10/10/2024, Until: 20/10/2024
- Valid Config Date - Since: 11/10/2024, Until: 19/10/2024
- Invalid Config Date - Since: 9/10/2024, Until: 21/10/2024
- If only one of the CLI flags is provided, the Config dates will not be restricted by the missing CLI flag.
- If Config dates are missing, the CLI flags are used.
- If neither Config nor CLI provides dates, default date ranges are used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Behavior When Both Report Config Dates & CLI Flags Are Provided:
- If `since` date is specified in both `report-config.yaml` and CLI, the **Config dates take precedence** for that repository. The same applies to `until` date.
- The Config date range must fall within the **CLI date boundaries**. If it exceeds, the program exits with an error.
- Example:
- CLI Date - Since: 10/10/2024, Until: 20/10/2024
- Valid Config Date - Since: 11/10/2024, Until: 19/10/2024
- Invalid Config Date - Since: 9/10/2024, Until: 21/10/2024
- If only one of the CLI flags is provided, the Config dates will not be restricted by the missing CLI flag.
- If Config dates are missing, the CLI flags are used.
- If neither Config nor CLI provides dates, default date ranges are used.
**Behavior of `since`/`until` in report-config.yaml vs. `--since`/`--until` in CLI**
* If `since` date is specified in both `report-config.yaml` and CLI, the config date takes priority for that repository. The same rule applies to the `until` date.
* Config date range must fall **within** the CLI date range; otherwise the program exits with an error.
* Example with CLI `--since` = 10/10/2024, `--until` = 20/10/2024:
* Valid config dates: `since` = 11/10/2024, `until` = 19/10/2024
* Invalid config dates: `since` = 9/10/2024, `until` = 21/10/2024
* If only one CLI flag is provided, the missing CLI value does not restrict config dates.
* If config dates are missing, CLI values are used.
* If neither provides dates, default ranges are applied.

Perhaps this is clearer?

private static final Logger logger = LogsManager.getLogger(OneStopConfigRunConfiguration.class);
private static final String MESSAGE_CLI_CONFIG_DATE_CONFLICT =
"You specified in CLI a date range of --since to --until, "
+ "but your report config specifies a date range that extends outside --SINCE or --UNTIL. "
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
+ "but your report config specifies a date range that extends outside --SINCE or --UNTIL. "
+ "but your report config specifies a date range that extends outside --since or --until. "


ReportBranchData branch = new ReportBranchData("master", "My project", authorList,
ignoreGlobList, ignoreAuthorList, 2000000L);
ignoreGlobList, ignoreAuthorList, 2000000L, sinceDate, untilDate);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also add the values for expectedRepoConfigurations?

String untilDateStr = "30/5/2025";

ReportBranchData data = new ReportBranchData(branch, blurb, authors, ignoreGlobs, ignoreAuthors, fileSize);
ReportBranchData data = new ReportBranchData(branch, blurb, authors, ignoreGlobs, ignoreAuthors, fileSize,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you should add the assert for the new fields as well?

// if both since and until date are provided in cli, then we need to check whether config date lays between
// the time period
if (configDate.isBefore(cliSinceDate) || configDate.isAfter(cliUntilDate)) {
throw new InvalidDatesException(MESSAGE_CLI_CONFIG_DATE_CONFLICT);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help to edit the comment description of InvalidDatesException.java?

@CYX22222003 CYX22222003 removed the Stale label Dec 11, 2025
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.

Support different time periods for different repos for report-config.yaml

3 participants