-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide association between program source and created resource #899
Comments
Mozilla has a very cool library for dealing with source maps: https://github.com/mozilla/source-map. |
Let's try to put in the foundation for this during M11, and then we can light it up in the UI during M12. |
@swgillespie just FYI, spoke to @khyperia earlier today about https://github.com/pulumi/pulumi-service/issues/766, which will give us basic source viewing support. I think the source map stuff will take a bit longer to hammer out, so I'm going to move this to M12. Let's think about how these two workstreams eventually dock in together, however. |
Just spoke to @joeduffy about this and I think there are two desirable sub-tasks here:
Some thoughts on this:
As part of this issue I think we need to decide on the format that we'd like to use to persist source information across service boundaries. I don't think we should be in the business of storing custom debug formats for every language we'd want to support, since we'd end up in a combinatorial explosion of formats. |
It's interesting to ask what "first frame of user code" means - and what we think should actually be displayed here. In practice today - the frames look like:
I assume since we're talking about the resource creation itself, that we mean the second one above. That will effectively always be in In the general case, We could assume that anything under Probably the most useful/expected would be the third item above - the place where |
I don't quite understand this one. Where would we use this? And what do we mean by "lambda"? |
Perhaps the "context" of resource creation can be a full stack trace, then? In that case it can be up to the user to decide what frames they care about. "Lambda" I meant in the AWS sense, providing some way to correlate an AWS Lambda resource with a JavaScript function that was serialized and is now running in the serverless instance. Something like, when a user discovers that their program deployed a serverless resource, they can see what code got serialized and is now running. |
Sure - though I suppose it depends what goal we have for displaying this to users.
I see. There are going to in general be many function bodies from the source code which are part of the Lambda, and some subset of those which are in some definition of "user code". For both of these scenarios, would be useful to sketch an example of what this might look like in a real world use case, to make sure that we have a target experience in mind before diving too far into particular implementation techniques - it seems very possible that the implementation strategy might differ based on what experience we think can be most useful/interesting to users. |
Moving out of 0.12 so we can focus on other core engine work this week. Given current priorities, I'm moving to 0.16, but let's discuss any need to prioritize this sooner in the context of fleshing out details of https://github.com/pulumi/home/issues/59. |
This issue keeps getting punted and we have no real product-wide plan here. I'm going to close this out. If we still want a feature of this magnitude, we should come up with a new design for it. |
There is no association between resources created by a Pulumi program and the program itself. For example, resource X was created by "/src/database.ts@(3:10-3:26)". (i.e. the file, line/col span.)
To support this, we could provide a way for the language host to be fed language-specific diagnostic files (source maps, PDBs, etc.) and optionally include that when making resource requests to the engine.
Being able to navigate from the created resource to the original source context would be, dare I say, ✨ magical ✨ .
/cc @CyrusNajmabadi @lukehoban
The text was updated successfully, but these errors were encountered: