Skip to content

Add SkillLens GitHub Action based on SPEC.md#3

Merged
ivan-magda merged 29 commits into
mainfrom
copilot/implement-skillance-github-action
Oct 8, 2025
Merged

Add SkillLens GitHub Action based on SPEC.md#3
ivan-magda merged 29 commits into
mainfrom
copilot/implement-skillance-github-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 7, 2025

Implementation Plan for SkillLens GitHub Action

Based on SPEC.md, implementing the following changes:

  • Review repository structure and baseline tests
  • Update action.yml metadata with SkillLens inputs/outputs
  • Add @actions/github dependency to package.json
  • Implement src/main.ts with core functionality:
    • Data fetch functions (inline comments, reviews, conversation)
    • Normalization and code fence trimming
    • OIDC token retrieval
    • Proxy API call
    • Comment upsert logic
  • Create comprehensive unit tests for new functionality
  • Update test fixtures to support mocking
  • Bundle and verify dist/index.js is generated
  • Run all tests to verify implementation (18 tests passing, 96%+ coverage)
  • Lint code and fix all issues
  • Revert dist files to original state (per review feedback)
  • Revert SPEC.md formatting changes (per review feedback)

Implementation complete! The action now:

  • Fetches PR review data from GitHub API
  • Normalizes and redacts code blocks (privacy)
  • Calls SkillLens Proxy with OIDC authentication
  • Creates/updates a single PR comment with learning recommendations

Note: dist files and SPEC.md have been reverted to their original state.

Original prompt

Implement SkillLens GitHub Action based on SPEC.md


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Update action.yml with SkillLens inputs/outputs and branding
- Add @actions/github dependency for GitHub API access
- Implement main.ts with:
  - Review data fetching (inline comments, reviews, conversations)
  - Code fence redaction and noise filtering
  - OIDC token retrieval for backend authentication
  - Proxy API call with proper error handling
  - PR comment upsert logic (create/update with marker)
- Add comprehensive unit tests with 96%+ coverage
- Create test fixtures for mocking GitHub API
- Bundle TypeScript to dist/index.js

Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com>
@ivan-magda

This comment was marked as outdated.

Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com>

This comment was marked as outdated.

@ivan-magda

This comment was marked as outdated.

Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com>

This comment was marked as outdated.

ivan-magda and others added 12 commits October 7, 2025 21:36
…e several packages, including @actions/cache to version 4.1.0 and @azure/core-auth to version 1.10.1. This also includes updates to various other Azure packages and improvements in license declarations across dependencies.
Update the test-action job in ci.yml to use the correct SkillLens action inputs (skilllens-api-url) and outputs (topics-json, comment-url) instead of the old template code. Exclude CLAUDE.md and SPEC.md from super-linter as these are project documentation files that don't need to follow strict markdown/terminology rules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The test-action job was failing with "GITHUB_TOKEN is required" error. This fix adds the required permissions (pull-requests: write, issues: write, id-token: write) to the job and passes GITHUB_TOKEN as an environment variable to the action.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
ivan-magda and others added 11 commits October 7, 2025 23:24
…erage badge to 97.05%; enhance debug logging in main.ts for better troubleshooting
…ion; update API URL in main.ts to a constant; adjust tests accordingly; update coverage badge to reflect new percentage of 97.02%
All inputs already have defaults defined in action.yml, so the fallback values in code (|| 'default') were redundant. Simplified code to rely on action.yml defaults as the single source of truth.
- Network errors (DNS, connection failures) now respect fail-on-proxy-error flag
- Previously network errors always failed the workflow regardless of the setting
- Refactored to eliminate duplicate fail-on-proxy-error input reading
- Added test coverage for network error scenarios with both flag states
- Coverage remains at 97.27%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added test case to cover lines 185-186 in src/main.ts which handle
the error when GITHUB_TOKEN is not provided.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Downgrade pull-requests permission from write to read in CI workflow
- Update documentation in CLAUDE.md and SPEC.md to reflect correct permissions
- Action only reads PR data and writes comments via issues API
- Follows principle of least privilege for security
Replace logical OR (||) with nullish coalescing (??) operator when
handling review.submitted_at timestamps. This ensures only null or
undefined values fallback to empty string, not other falsy values,
following JavaScript/TypeScript best practices.
- Renamed action to 'SkillLens: PR Review Learning & Developer Growth' for clarity.
- Enhanced description to reflect the action's functionality in transforming PR feedback into personalized learning paths.
- Updated package.json to change the name and description, and added relevant keywords for better discoverability.
- Revamped README to provide a comprehensive overview of SkillLens, including usage instructions, features, and benefits, while improving the overall structure and clarity.
- Changed the SkillLens API URL from the original endpoint to a new Replit URL in main.ts.
- Updated the test to reflect the new API URL, ensuring that the mock fetch call aligns with the change.
@ivan-magda ivan-magda marked this pull request as ready for review October 8, 2025 10:08
Copilot AI review requested due to automatic review settings October 8, 2025 10:08
Copy link
Copy Markdown
Contributor

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 implements the SkillLens GitHub Action based on the SPEC.md specification, transforming PR review feedback into personalized learning recommendations. The implementation replaces the template's wait functionality with a comprehensive system that fetches review data from GitHub APIs, calls a SkillLens proxy with OIDC authentication, and creates/updates PR comments with educational resources.

  • Complete core functionality implementation including GitHub API integration, OIDC authentication, and comment management
  • Comprehensive test suite with 96%+ coverage for all major components and error scenarios
  • Updated metadata, configuration, and documentation to reflect the new SkillLens purpose

Reviewed Changes

Copilot reviewed 14 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main.ts Complete rewrite implementing core SkillLens functionality (data fetching, normalization, API calls, comment management)
src/wait.ts Removed template wait functionality (no longer needed)
action.yml Updated metadata with SkillLens inputs/outputs and branding
package.json Updated project metadata, added @actions/github dependency, and enhanced keywords
__tests__/main.test.ts Comprehensive test suite covering all functionality and edge cases
__tests__/wait.test.ts Removed obsolete wait function tests
__fixtures__/github.ts Added GitHub API mocking fixtures for testing
__fixtures__/core.ts Added getIDToken mock for OIDC testing
README.md Complete rewrite with SkillLens documentation, usage examples, and FAQs
SPEC.md Minor formatting and content clarifications
CLAUDE.md Added comprehensive development guidance document
.prettierignore Added exclusions for documentation files
.github/workflows/linter.yml Updated to exclude documentation files from linting
.github/workflows/ci.yml Updated test workflow with proper permissions and SkillLens inputs
Comments suppressed due to low confidence (1)

src/main.ts:1

  • The comment on line 182 in SPEC.md mentions the API URL should be 'https://api.skilllens.dev/v1/recommendations', but the actual implementation uses a different URL. There's an inconsistency between the specification and implementation.
import * as core from '@actions/core'

Comment thread src/main.ts
Comment on lines +3 to +4

const SKILLLENS_API_URL =
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The hardcoded API URL appears to be pointing to a Replit development environment, which may not be stable for production use. Consider making this configurable via an input parameter or using a production API endpoint.

Suggested change
const SKILLLENS_API_URL =
// Make the API URL configurable via environment variable, fallback to default (Replit dev endpoint)
const SKILLLENS_API_URL =
process.env.SKILLLENS_API_URL ||

Copilot uses AI. Check for mistakes.
Comment thread src/main.ts
Comment on lines +238 to +239
const data = (await resp.json()) as {
topics: unknown[]
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The topics array is typed as 'unknown[]' which provides no type safety. Consider defining a proper interface for the topic structure to improve type safety and code maintainability.

Suggested change
const data = (await resp.json()) as {
topics: unknown[]
interface Topic {
// Define the expected properties of a topic here.
// For example:
id: string;
name: string;
description?: string;
// Add more fields as needed based on API response.
}
const data = (await resp.json()) as {
topics: Topic[]

Copilot uses AI. Check for mistakes.
- Fix MD051: Update anchor links to match actual section IDs
- Fix MD029: Use consistent ordered list numbering (style: one)
- Fix MD013: Break long line in code example
- Fix MD034: Convert bare email to proper markdown link
- Fix MD033: Configure markdownlint to allow GitHub-friendly HTML elements
- Fix terminology: Replace 'repo' with 'repository' throughout
- Fix terminology: Replace 'VS Code' with 'Visual Studio Code'
- Run prettier formatting on tables for better alignment

All linting checks now pass successfully.
@ivan-magda ivan-magda changed the title [WIP] Add SkillLens GitHub Action based on SPEC.md Add SkillLens GitHub Action based on SPEC.md Oct 8, 2025
@ivan-magda ivan-magda merged commit 6a2d27c into main Oct 8, 2025
24 checks passed
@ivan-magda ivan-magda deleted the copilot/implement-skillance-github-action branch October 8, 2025 10:21
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.

3 participants