-
Notifications
You must be signed in to change notification settings - Fork 39
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
check for annotated file as entrypoint #225
Conversation
cap := annot.Capability | ||
if cap.Name == annotation.ExecutionUnitCapability && cap.ID == unit.Name { | ||
if len(unit.Executable.Entrypoints) == 1 { | ||
return core.WrapErrf(err, "entrypoint resolution failed for execution unit: %s. Too many annotated files with the same execution unit ID", unit.Name) |
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.
Multiple files with the same execution unit ID is not an error. Remember that what currently distinguishes an Entrypoint
from a SourceFile
is that Entrypoint
s are used as roots for the file dependency graph.
(same goes for the other languages)
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.
whats the use case with multiple lang files with the same exec unit id?
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.
i can definitely remove this but i wasnt able to think of a reason why we should allow it
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.
A case where a file (and its dependencies) are utilized by the execution unit, but are imported/loaded dynamically rather than statically somewhere in the execution unit. This could be directly in the user's code or via a supported framework/application server that executes the user's source code.
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.
hm, but we arent parsing and reading in those dynamic files are we? im fine removing it for now, but im curious to hear your thoughts and revisit this later
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.
The files aren't dynamically generated, just their usage. An example of this might be a Django migration script. It's not going to be imported anywhere in your application, but when you need to execute it with the django-admin
CLI in a cloud environment, you need a way to ensure that it's included in an execution unit. The annotation is an easy way to accomplish this (though there may be a more optimal/ideal solution).
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.
oh thats fair. Yeah i figure an extension of execution may be beneficial if its something that needs to be run before boot, but i guess if it needs to be run on the side then yeah this would work
|
• Does any part of it require special attention?
• Does it relate to or fix any issue?
We have a slight bug with proxy + pruning combo due to the addition of source files instead of entrypoints. This is because when we dont have the annotated files added as entry points we then prune everything since thats how the dependecy resolver is based.
Standard checks