Skip to content

Conversation

mbg
Copy link
Member

@mbg mbg commented Sep 2, 2025

This PR updates sendCompletedStatusReport to use the computed packs from computedConfig rather than computing the packs from the input UserConfig and AugmentationProperties locally.

As a result, AugmentationProperties is no longer needed in Config and is removed.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

@mbg mbg force-pushed the mbg/remove-augmentation-properties branch from 1ef359a to 87c5b58 Compare September 3, 2025 11:57
Base automatically changed from mbg/refactor/augmentation-properties to main September 3, 2025 15:40
@mbg mbg marked this pull request as ready for review September 3, 2025 15:41
@mbg mbg requested a review from a team as a code owner September 3, 2025 15:41
@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 15:41
Copy link
Contributor

@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 removes the augmentationProperties field from the Config type by updating sendCompletedStatusReport to use computed packs from computedConfig instead of calculating them from UserConfig and AugmentationProperties. The change simplifies the configuration interface while maintaining the same functionality.

Key changes:

  • Removed augmentationProperties from the Config type definition
  • Updated getDefaultConfig return type to temporarily include augmentationProperties for internal use
  • Simplified pack calculation logic in sendCompletedStatusReport to use computedConfig.packs directly

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/config-utils.ts Removes augmentationProperties from Config type and updates getDefaultConfig return type
src/init-action.ts Simplifies pack calculation logic to use config.computedConfig.packs directly
src/testing-utils.ts Removes augmentationProperties import and removes the field from test config creation
src/config-utils.test.ts Updates test to destructure augmentationProperties from getDefaultConfig result
src/codeql.test.ts Updates test to pass augmentationProperties directly to generateCodeScanningConfig
lib/init-action.js Generated JavaScript file (not reviewed per guidelines)

henrymercer
henrymercer previously approved these changes Sep 3, 2025
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Before merging, could you run some of the PR checks that include packs in debug mode and check that the packs property is populated correctly?

@@ -1104,14 +1100,14 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
);
}

const config = await getDefaultConfig(inputs);
const { augmentationProperties, ...config } = await getDefaultConfig(inputs);
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we only use getDefaultConfig in this function, consider having getDefaultConfig populate computedConfig directly to simplify the flow.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have made the UserConfig (from the inputs) an argument to getDefaultConfig (now initActionState), set it there, and generate computedConfig there. That avoids having to return augmentationProperties as well.

@mbg
Copy link
Member Author

mbg commented Sep 4, 2025

@henrymercer I refactored creating the InitWithConfigStatusReport into a function and added some unit tests for that. That should be more robust than checking the debug logs, but let me know if you still want me to do that as well?

@mbg mbg requested a review from henrymercer September 4, 2025 10:01
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Great, even better!

@mbg mbg merged commit dfb741d into main Sep 4, 2025
278 checks passed
@mbg mbg deleted the mbg/remove-augmentation-properties branch September 4, 2025 10:31
@github-actions github-actions bot mentioned this pull request Sep 5, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants