Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 29, 2025

  • Analyze the issue with hardcoded codegen includes in init-windows template
  • Scan codegen directory for existing spec files during template generation
  • Update template to use actual filenames when existing spec files are found
  • Add fallback to conditional includes when no existing files are present
  • Test the solution with existing projects
  • Add explanatory comments about Mustache template syntax for C++ developers
  • Run yarn change prerelease and yarn lint:fix
  • Revert unrelated changes to FlatList file
  • Fix Mustache template parsing error caused by example syntax in comments

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Microsoft Reviewers: Open in CodeFlow

@anupriya13
Copy link
Contributor

anupriya13 commented Aug 29, 2025

@copilot don't add a comment for developer to fix, we need to get the correct file name from..\codegen\<filename>.g.hfile

Copilot AI changed the title [WIP] [Bug] init-windows adds incorrect name of Native Codegen File Include Fix init-windows template to use conditional codegen includes Aug 29, 2025
Copilot finished work on behalf of anupriya13 August 29, 2025 13:43
Copilot AI requested a review from anupriya13 August 29, 2025 13:43
Copy link
Contributor Author

Copilot AI commented Aug 29, 2025

@copilot don't add a comment for developer to fix, we need to get the correct file name from..\codegen\<filename>.g.hfile

I've updated the solution to automatically detect existing codegen spec files instead of using TODO comments. The template now:

  1. Scans the windows/{projectName}/codegen/ directory for existing *Spec.g.h files during template generation
  2. If existing spec files are found, uses the actual filename and extracted module name
  3. Falls back to conditional __has_include checks when no existing files are found

This eliminates the need for manual developer intervention while handling both scenarios correctly. (commit b02696d)

Copilot AI changed the title Fix init-windows template to use conditional codegen includes Fix init-windows template to automatically detect existing codegen spec files Aug 29, 2025
Copilot finished work on behalf of anupriya13 August 29, 2025 13:53
Copy link
Contributor

@sundaramramaswamy sundaramramaswamy left a comment

Choose a reason for hiding this comment

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

LGTM!

Copilot finished work on behalf of sundaramramaswamy September 30, 2025 03:22
Copy link
Contributor

@sundaramramaswamy sundaramramaswamy left a comment

Choose a reason for hiding this comment

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

LGTM

@sundaramramaswamy sundaramramaswamy marked this pull request as ready for review September 30, 2025 06:09
@sundaramramaswamy sundaramramaswamy requested a review from a team as a code owner September 30, 2025 06:09
@sundaramramaswamy
Copy link
Contributor

sundaramramaswamy commented Sep 30, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@anupriya13
Copy link
Contributor

@copilot run yarn change prerelease and yarn lint:fix

Copy link
Contributor Author

Copilot AI commented Nov 3, 2025

@copilot run yarn change prerelease and yarn lint:fix

Completed both tasks:

  1. Generated prerelease change file with description "Fix init-windows template to automatically detect existing codegen spec files"
  2. Fixed linting issues - corrected spacing in template.config.js and cleaned up FlatList file
    (commit e6f2c9f)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: /usr/local/bin/node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.116/linux64/chrome-linux64.zip
    • Triggering command: /usr/local/bin/node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of anupriya13 November 3, 2025 15:33
Copilot AI requested a review from anupriya13 November 5, 2025 08:21
Copilot finished work on behalf of anupriya13 November 5, 2025 08:21
@anupriya13
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@anupriya13 anupriya13 enabled auto-merge (squash) November 5, 2025 08:22
@anupriya13
Copy link
Contributor

@copilot fix pipeline issues for fabric

new windows\testcli\testcli.cpp
new windows\testcli\testcli.def
× Running init-windows...
Error: Error: Unclosed section "variable" at 1794. (90ms)
Command failed with error Unknown: Unclosed section "variable" at 1794
creaternwlib.cmd Done, see new cpp-lib project in D:\a_work\1\testcli with [email protected], [email protected], and [email protected]
##[error]Cmd.exe exited with code '-1'.
Finishing: Init

Copy link
Contributor Author

Copilot AI commented Nov 5, 2025

@copilot fix pipeline issues for fabric

new windows\testcli\testcli.cpp...

Fixed the Mustache template parsing error. The issue was that the explanatory comments contained example Mustache syntax tags ({{#variable}}, {{^variable}}, {{/variable}}) which the template parser was trying to process as actual template code, causing the "Unclosed section 'variable' at 1794" error. Removed the example syntax from the comments while keeping the explanations. (commit 4f5620f)

Copilot finished work on behalf of anupriya13 November 5, 2025 12:45
Copilot AI requested a review from anupriya13 November 5, 2025 12:45
@anupriya13
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@anupriya13 anupriya13 merged commit 26d93dc into main Nov 5, 2025
76 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 7, 2025
…ec files (#15096)

* Initial plan

* Fix init-windows template to use conditional codegen includes

Co-authored-by: anupriya13 <[email protected]>

* Automatically detect existing codegen spec files instead of using hardcoded names

Co-authored-by: anupriya13 <[email protected]>

* Add explanatory comments about Mustache template syntax for C++ developers

Co-authored-by: sundaramramaswamy <[email protected]>

* Change files

* Run yarn change prerelease and yarn lint:fix

Co-authored-by: anupriya13 <[email protected]>

* Revert unrelated changes to FlatList-multiColumn.windows.js

Co-authored-by: anupriya13 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: anupriya13 <[email protected]>
Co-authored-by: sundaramramaswamy <[email protected]>
Co-authored-by: Sundaram Ramaswamy <[email protected]>
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.

[Bug] init-windows adds incorrect name of Native Codegen File Include

4 participants