-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add logger interface and implementation for better logging in actions #2
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
Conversation
…ctions chore: update package.json to include jscpd and madge for code duplication analysis build: create rollup.config.js for ES module bundling fix: modify rollup.config.ts to handle circular dependency warnings test: refactor action tests to use ILogger for logging refactor: update Action class to use ILogger for logging instead of core docs: add JSDoc comments for Action class and methods chore: update tsconfig.json for better module isolation chore: add tsconfig.test.json for test-specific TypeScript configuration
There was a problem hiding this 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 introduces a logger abstraction layer to improve testability and maintainability of the GitHub Action by replacing direct @actions/core usage with an ILogger interface. It also includes build configuration improvements and enhanced documentation.
Key changes:
- Adds ILogger interface and CoreLogger implementation for better dependency injection
- Refactors Action class to use ILogger instead of direct @actions/core calls
- Updates build configuration with new rollup.config.js and circular dependency handling
- Adds comprehensive project documentation and EditorConfig setup
Reviewed Changes
Copilot reviewed 12 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/logger.ts | New logger interface and implementation wrapping @actions/core |
| src/action.ts | Refactored to use ILogger dependency injection with JSDoc documentation |
| src/action.test.ts | Updated tests to use mocked ILogger instead of @actions/core |
| src/index.ts | Added JSDoc documentation and improved function structure |
| rollup.config.js | New ES module build configuration with circular dependency handling |
| package.json | Added jscpd, madge tools and updated build scripts |
| tsconfig.test.json | Added isolatedModules setting for better module isolation |
| README.md | Comprehensive documentation of project structure and usage |
| .editorconfig | Added consistent coding style configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
feat: add Jest configuration for testing with coverage reporting chore: update package-lock.json to Rollup version 4.52.0 and related dependencies fix: update linting scripts in package.json to use npm exec refactor: improve warning handling in Rollup configuration delete: remove unused rollup.config.ts file fix: update tsconfig.test.json to reference jest.config.cjs
…ogger - Added CoreLogger to wrap @actions/core logging functions. - Introduced PinoLogger for structured logging with Pino. - Created CompositeLogger to combine CoreLogger and PinoLogger. - Implemented FilteredLogger to apply filtering and sampling strategies. - Added MetricsLogger to collect logging metrics and telemetry. - Developed MockLogger for testing purposes, capturing log calls. - Introduced NoopLogger as a fallback when Pino initialization fails. - Updated types and interfaces for logging, including ILogger and ILogMetadata. - Enhanced TypeScript configuration with baseUrl and path mappings.
… configuration to disable JavaScript standard validation
Description
chore: update package.json to include jscpd and madge for code duplication analysis
build: create rollup.config.js for ES module bundling
fix: modify rollup.config.ts to handle circular dependency warnings
test: refactor action tests to use ILogger for logging
refactor: update Action class to use ILogger for logging instead of core
docs: add JSDoc comments for Action class and methods
chore: update tsconfig.json for better module isolation
chore: add tsconfig.test.json for test-specific TypeScript configuration
Checklist