Pulumi output handling during preview - pulumi

I'm trying to figure out how to work well with outputs dependency and previews on Pulumi.
I’m trying to fetch an aws cert using getIssuerCAThumbprint() function with TypeScript, which gets a http agent and an issueUrl output.
When i’m trying to preview it’s waiting the cert to be fetched and really waiting the issueUrl output to be resolved, but it's not the desired behavior I was imagining when previewing code with outputs.
I thought that the function that gets the output will return kind of mock result or something that will let the preview run successfully because in that way i cannot run my preview without failing.
Any idea what i'm doing wrong ? or understanding wrong ?

Related

Use openapi service in Flutter Drive integration test, but run into dart:ui problem

The app I am trying to test makes use of feature toggles to enable/disable certain parts of the app. However, the tests I've written are for all the features. When a user logs in, this will fetch the feature toggles from a REST service (using a class which uses the generated openapi) so the app knows what to show and what not to show.
Now I want to include those feature toggles in my tests, so that the corresponding tests are skipped and don't just fail if some parts aren't enabled. However, when I try to include the class that does the call, I get problems with dart:ui in the console, and the test no longer runs. When I (recursively) check the imports on those service classes, there are some imports to widgets.dart, so I guess that's the problem. I tried removing most of it, but since we're using Localized strings for error messages etc. it's getting to be a very cumbersome job to remove all of that from those files.
So before I continue doing that, I was wondering if there is any easy way to include a call to a REST service in an integration test?
I checked the Flutter drive documentation, and searched for some similar questions online but haven't really found anything similar.

Using codemirror to execute code on server

Novice to Codemirror.
I have codemirror running on my server I have it set to Python mode. Can someone please suggest how I go about executing the code and showing the result on the page where I have written the python code
Thanks
Without knowing much about your setup, here's a general idea:
Use the getValue() method to get the code from your CodeMirror instance.
Assuming the code is a run-able Python script, you can either
(1) send the code to your back end with AJAX or a POST request and run it there. Or (2) you could run the Python script in the browser with a library like one discussed here.
If you ran it on the back end, you can send the result of running the code back as text or JSON with your preferred protocol. If you ran it on the browser, you should probably follow the guidelines for the specific library you used.

Error Log Transformation could not be executed

We have a transactional App of SAP Fiori Element and the app is working fine in the DEV environment.
but in Quality /n/iwfnd/error_log it is giving an error
..ERROR_INFO The transformation /1IWST/AAGTVCXNHUPOVLGMOY6T37L could not be executed
I tried debugging code but no clue what is wrong here.
Can you please let me know what went wrong.
Thanks,
Abhi
Transformations in the /1IWST/ namespace are technical ST transformations for OData.
Go to that transformation in STRANS tcode and open it
in the comments at the top-side you can check the name of the OData service.
The errors in this transformation mean there is some inconsistency in your OData model.
Try to re-import the model and re-check the attribuites.

KsqlRestClient.makeKsqlRequest("RUN SCRIPT ...") doesn't work without filling ksql.schema.file.content with the script content yourself

In my Scala application, I am trying to tell my KSQL Server that it should execute the RUN SCRIPT <script> command, using the KsqlRestClient.makeKsqlRequest(String ksql) function. Every time I tried it, nothing happened, even though the response was successful, so I started debugging, where I saw that the response was a success but it also returned some kind of error that the property ksql.schema.file.content was empty.
Since I did not find any documentation as to what to fill this property with, I tried some things and eventually found out that if you fill this property with the contents of your .sql file, the run script command works.
Does anybody know if and with what ksql.schema.file.content should normally be filled and/or if the way I am using it is how your supposed to execute a script in KSQL from a Scala application. I already copy and pasted the text from the makeKsqlRequest into the KSQL CLI and everything worked fine, so there should be no error with that.
There is a Github issue tracking the fact that the RESTful API is not documented / supported yet, (as of March 2018).
It sounds like this is something you may want to add a +1 too.

Issues with WebIDE CRUD template and OData errors

Has anyone successfully based an application off the WebIDE Fiori CRUD template? It doesn't seem to be able to handle errors in the batch OData request properly.
For example when you select an item in the master list and click EDIT to update it and I enter a value that I know will cause an error in the backend. The batch OData request is sent and the response is successful (overall) even though internally the update failed. You see a bad request 400 error in the console but the app doesn't react to it.
Using the ErrorHandler.js object you can easily code a message box to show a nice error message, however the app seems to get confused and always navigates to the top item in the list but the ODataModel still has pending changes so if you try to navigate it shows the data loss dialog.
Trying to debug it is very painful given the nature of the code with Promises inside promises inside promises and callbacks firing everywhere!!
Maybe there is a better example CRUD application to base your apps on?
Well.... Some more debugging and I've found that all of the weird issues occurring with the Fiori CRUD template are due to the model defaulting to auto refreshing after changes.
Which typically is a nice feature as the user does not have to hit the refresh button to see changes that have been made after adding a new entry or editing an object.
But this auto refresh on the model seems to play havoc with updates in batch mode.
Firstly, if the batch update is completely successful the app navigates to the first item in the master list - which is should not.
Secondly, when there is an error in the batch of sorts of weird shit happens.
So to fix this I just call oModel.setRefreshAfterChange(false) before the oModel.submitChanges() call (only when updating, not creating). The in the callback after the save is completed we reset auto refresh to true.
The crud app now works as expected and can correctly handle errors in the odata batch update without strange ui updates.
Jason,
but the error message they are providing is very simple, and does not support parsing error body like :
<code>005056A509B11ED199D882461C8C40FE</code><message xml:lang="en">The Data Services Request version '3.0' is not supported for the request payload.</message><
we have to do the code for parsing the errors then show in the message box