Skip to content

fix(post-gen-hook): populate project.yml with more accurate details#26

Merged
JonZeolla merged 5 commits into
mainfrom
fix-project.yml
Jul 9, 2025
Merged

fix(post-gen-hook): populate project.yml with more accurate details#26
JonZeolla merged 5 commits into
mainfrom
fix-project.yml

Conversation

@JonZeolla

@JonZeolla JonZeolla commented Jul 8, 2025

Copy link
Copy Markdown
Member

Contributor Comments

This fixes the generated .github/project.yml to have correct details about the generation of a repo.

Now it looks like this:

...
origin:
  template:
    branch: unknown
    commit hash: unknown

Previously it looked like this in my local testing:

origin:
  generated: true
  template:
    branch: main
    commit hash: ''

Pull Request Checklist

Thank you for submitting a contribution!

Please address the following items:

  • If you are adding a dependency, please explain how it was chosen.
  • If manual testing is needed in order to validate the changes, provide a testing plan and the expected results.
  • Validate that documentation is accurate and aligned to any project updates or additions.

@ai-coding-guardrails ai-coding-guardrails Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I've got 2 comments for you to consider

The PR title and description are not accurate. Here are my suggestions:

Title: refactor(post-gen-hook): improve template handling and fix project.yml generation

Description: # Contributor Comments

This PR refactors the post-generation hook with several improvements:

Key Changes

  • Template handling: Added distinction between remote and local templates for better context resolution
  • Performance: Implemented lazy loading for git imports
  • Code quality: Removed pylint disable comments and improved code structure
  • Project metadata: Fixed generated .github/project.yml to populate correct details about repo generation

Project.yml Improvements

The generated project metadata now includes proper template information with fully qualified paths instead of local development paths.

Previously the generated file contained local paths like:

_template: /Users/jonzeolla/src/zenable/testing
location: /Users/jonzeolla/src/zenable/testing

Now it properly reflects the actual template source and generation context.

Pull Request Checklist

  • If you are adding a dependency, please explain how it was chosen.
  • If manual testing is needed in order to validate the changes, provide a testing plan and the expected results.
  • Validate that documentation is accurate and aligned to any project updates or additions.

Reviewed with 🤟 by Zenable

Comment thread hooks/post_gen_project.py
Comment thread hooks/post_gen_project.py Outdated
@JonZeolla JonZeolla enabled auto-merge (squash) July 9, 2025 00:40
@JonZeolla JonZeolla changed the title fix(post-gen-hook): populate project.yml with correct details fix(post-gen-hook): populate project.yml with more accurate details Jul 9, 2025
@JonZeolla JonZeolla merged commit 60271c5 into main Jul 9, 2025
9 checks passed
@JonZeolla JonZeolla deleted the fix-project.yml branch July 9, 2025 00:46
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.

1 participant