-
Notifications
You must be signed in to change notification settings - Fork 35
docs: Separate compile-time and runtime imports documentation #10061
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
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
|
@dsyme FYI, this would make a clearer distinction between compile vs. runtime imports. Does this work for you? |
|
Maybe we simplify things and only support @? |
That would work for me 👍🏼 @dsyme what are your thoughts? |
|
I don't mind syntax. But I think having both makes sense as "@" may run into trouble if spaces are in names, or weird unicode characters etc |
|
Actually I think it's important to say "runtime", also there should be alignment with static imports. I think "@" is way too subtle Right now we have I think we should just have the first two to be honest. It's really a big security matter to review for runtime imports and assess who can change them isn't it? Don't we have to make this explicit? But I don't think we should only have As an aside do we really trust our code to find only truly intentional "@"? What if there's an "@./" in the middle of some markdown etc? Also the business about the ".github" directory needs to be checked. Static imports and runtime imports sho0uld use identical resolution. Things like "All file paths are resolved within the .github folder, so @./file.md refers to .github/file.md in your repository" make me feel the two are not aligned. Speaking of which I'm unclear, do runtime imports require the repo to have been checked out in the Actions VM or do they do a GitHub fetch from main? |
I agree
As far as I understand, it loads the imported file/module from the runner’s filesystem at job runtime (from whatever is present in the workspace after checkout/other steps). It does not go to GitHub and fetch main by itself. @pelikhan What's the final verdict here? |
|
Ok let's remove "@" |
|
I will start a PR to remove it and make file path resolution more precise (full relative repo path, must be .github) |
|
@dsyme note the "@" is the syntax that copilot uses to import files... so it will happen through us or the agent |
The imports documentation mixed two distinct mechanisms—compile-time imports (processed during
gh aw compile) and runtime imports (processed during workflow execution)—creating confusion about when to use each.Changes
reference/imports.md- Compile-time only@syntax) sectionimports:field,{{#import}},{{#import?}}reference/templating.md- Runtime imports enhanced@./pathis runtime, not compile-time{{#runtime-import}},{{#runtime-import?}},@./pathKey Distinction
gh aw compile{{#runtime-import}},@./pathimports:,{{#import}}Documentation-only change, no behavior changes.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.