Skip to content

Make "init not called" a configuration error #3050

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

Merged
merged 1 commit into from
Aug 20, 2025

Conversation

henrymercer
Copy link
Contributor

This error happens when analyze, autobuild, or resolve-environment is called before init.

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.
  • High risk: Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production.

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.

@henrymercer henrymercer requested a review from redsun82 August 20, 2025 13:56
@henrymercer henrymercer requested a review from a team as a code owner August 20, 2025 13:56
@Copilot Copilot AI review requested due to automatic review settings August 20, 2025 13:56
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 changes the error type for "init not called" scenarios from a generic Error to a more specific ConfigurationError. This affects three action files that check if the config file exists before proceeding.

  • Updates error handling to use ConfigurationError instead of generic Error for better error categorization
  • Adds necessary imports for ConfigurationError in the affected TypeScript files
  • Maintains the same error message to preserve existing behavior

Reviewed Changes

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

Show a summary per file
File Description
src/resolve-environment-action.ts Imports ConfigurationError and uses it for config not found error
src/autobuild-action.ts Imports ConfigurationError and uses it for config not found error
src/analyze-action.ts Uses util.ConfigurationError for config not found error
lib/resolve-environment-action.js Generated JavaScript code reflecting TypeScript changes
lib/autobuild-action.js Generated JavaScript code reflecting TypeScript changes
lib/analyze-action.js Generated JavaScript code reflecting TypeScript changes

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

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

LGTM. Would it make sense to add this logic to a wrapper around getConfig? E.g. getRequiredConfig or something, since it's re-used in a few places?

@henrymercer
Copy link
Contributor Author

Agreed, but I'll leave that as future work.

@henrymercer henrymercer merged commit a68d47b into main Aug 20, 2025
284 checks passed
@henrymercer henrymercer deleted the henrymercer/init-not-called-config-error branch August 20, 2025 15:36
@github-actions github-actions bot mentioned this pull request Aug 21, 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