anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: rasahq/rasa
Issue: cmd interface: train command should not fail if data folder contains more than train files

Currently, the command line interface fails to train the `nlu` or `core` model, if the data folder contains more than the expected training file.

Example:
Data folder contains `stories.md` and `nlu.md` and you execute the command `rasa nlu train`. The execution will fail with the following error:
```
ValueError: Unknown data format for file data/stories.md
```
If you run `rasa core train`, the execution fails with
```
TypeError: expected str, bytes or os.PathLike object, not NoneType
```

Current solution:
The data folder should contain only the training file you need to train your model. E.g. if you want to run `rasa train nlu`, the data folder should just contain `nlu.md`.

What needs to be done:
Ignore files in the data folder if they are not in the expected format, so that you don't have to move files before training any model.

Changed files:
rasa/train.py

diff --git a/rasa/train.py b/rasa/train.py
index 0a735277074..5478b3a10f1 100644
--- a/rasa/train.py
+++ b/rasa/train.py
@@ -149,7 +149,7 @@ async def train_core_async(
     # normal (not compare) training
     core_model = await rasa.core.train(
         domain_file=domain,
-        stories_file=stories,
+        stories_file=data.get_core_directory(stories),
         output_path=os.path.join(_train_path, "core"),
         policy_config=config,
         kwargs=kwargs,
@@ -189,7 +189,11 @@ def train_nlu(
 
     _train_path = train_path or tempfile.mkdtemp()
     _, nlu_model, _ = rasa.nlu.train(
-        config, nlu_data, _train_path, project="", fixed_model_name="nlu"
+        config,
+        data.get_nlu_directory(nlu_data),
+        _train_path,
+        project="",
+        fixed_model_name="nlu",
     )
 
     if not train_path:
Repository: rasahq/rasa
Issue: Exception raised on 'rasa init' when trying to speak to assistant

<!-- THIS INFORMATION IS MANDATORY - YOUR ISSUE WILL BE CLOSED IF IT IS MISSING. If you don't know your Rasa version, use `rasa --version`. 
Please format any code or console output with three ticks ``` above and below.
If you are asking a usage question (e.g. "How do I do xyz") please post your question on https://forum.rasa.com instead -->

**Rasa version**: `master` branch

**Rasa X version** (if used & relevant): -

**Python version**: 3.7.4

**Operating system** (windows, osx, ...): macOS

**Issue**:
After running `rasa init` and after the model is trained for the first time, the user is prompted with:
```
? Do you want to speak to the trained assistant on the command line? 🤖
```
If the user answers 'Yes', the script crashes with an exception.

**Error (including full traceback)**:
```
Traceback (most recent call last):
  File "/Users/federico/Workspace/rasa-x/env/bin/rasa", line 11, in <module>
    load_entry_point('rasa', 'console_scripts', 'rasa')()
  File "/Users/federico/Workspace/rasa/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/Users/federico/Workspace/rasa/rasa/cli/scaffold.py", line 194, in run
    init_project(args, path)
  File "/Users/federico/Workspace/rasa/rasa/cli/scaffold.py", line 112, in init_project
    print_train_or_instructions(args, path)
  File "/Users/federico/Workspace/rasa/rasa/cli/scaffold.py", line 52, in print_train_or_instructions
    print_run_or_instructions(args, path)
  File "/Users/federico/Workspace/rasa/rasa/cli/scaffold.py", line 90, in print_run_or_instructions
    shell(args)
  File "/Users/federico/Workspace/rasa/rasa/cli/shell.py", line 101, in shell
    rasa.cli.run.run(args)
  File "/Users/federico/Workspace/rasa/rasa/cli/run.py", line 99, in run
    if args.remote_storage is not None:
AttributeError: 'Namespace' object has no attribute 'remote_storage'
```

**Command or request that led to error**:
```
rasa init
```

**Content of configuration file (config.yml)** (if relevant): created by `rasa init`

**Content of domain file (domain.yml)** (if relevant): created by `rasa init`


Changed files:
rasa/cli/scaffold.py

diff --git a/rasa/cli/scaffold.py b/rasa/cli/scaffold.py
index a9062dc426e..5b0ebb9a8be 100644
--- a/rasa/cli/scaffold.py
+++ b/rasa/cli/scaffold.py
@@ -81,6 +81,7 @@ def print_run_or_instructions(args: argparse.Namespace, path: Text) -> None:
             "jwt_secret",
             "jwt_method",
             "enable_api",
+            "remote_storage",
         ]
         for a in attributes:
             setattr(args, a, None)
Repository: rasahq/rasa
Issue: NLU server logging to files does not work

<!-- If you don't know your Rasa NLU version, here is some help: https://goo.gl/g9QQg2. If you are creating a feature request, feel free to remove all the system information stuff. --> 

**Rasa NLU version**: all

**Operating system** (windows, osx, ...): OSX


**Issue**:

Logging to files with `--write` option doesn't work. Replacing the `_configure_logging()` method in `rasa_nlu.server` fixes the problem:
```python
@staticmethod
    def _configure_logging(loglevel, logfile):
        for handler in logging.root.handlers[:]:
            logging.root.removeHandler(handler)
        logging.basicConfig(filename=logfile,
                            level=loglevel)
        logging.captureWarnings(True)
```
I'm not sure if there's a better approach.

Also, there is no command line option for `--loglevel` which that function is supposed to use.


Changed files:
rasa/nlu/server.py

diff --git a/rasa/nlu/server.py b/rasa/nlu/server.py
index 49c89c2003f..4f35a543a1b 100644
--- a/rasa/nlu/server.py
+++ b/rasa/nlu/server.py
@@ -143,8 +143,11 @@ class RasaNLU(object):
 
     @staticmethod
     def _configure_logging(loglevel, logfile):
-        logging.basicConfig(filename=logfile,
-                            level=loglevel)
+        if logfile is None:
+            utils.configure_colored_logging(loglevel)
+        else:
+            logging.basicConfig(filename=logfile,
+                                level=loglevel)
         logging.captureWarnings(True)
 
     @app.route("/", methods=['GET', 'OPTIONS'])
@@ -362,7 +365,6 @@ def get_token(_clitoken: str) -> str:
 
 
 def main(args):
-    utils.configure_colored_logging(args.loglevel)
     pre_load = args.pre_load
 
     _endpoints = read_endpoints(args.endpoints)
Repository: rasahq/rasa
Issue: cloud storage tar file creation issue

<!-- If you don't know your Rasa NLU version, here is some help: https://goo.gl/g9QQg2. If you are creating a feature request, feel free to remove all the system information stuff. --> 

**Rasa NLU version** (e.g. `0.7.3`): 
0.12.0a2
**Used backend / pipeline** (`mitie`, `spacy_sklearn`, ...): 
spacy_sklearn
**Operating system** (windows, osx, ...): 
osx
**Issue**:
Issue with tar file created when cloud storage is turned on.  

Believe it has something to do with tempfile.mkdtemp() command added to _compress in persistor.py here:

```
        dirpath = tempfile.mkdtemp()
        base_name = self._tar_name(model_name, project, include_extension=False)
        tar_name = shutil.make_archive(base_name, 'gztar',
                                       root_dir=model_directory,
                                       base_dir=dirpath)
```
When running this version of the code with cloud storage turned on the tar file produced has a temporary folder structure inside like this:

`var/folders/vx/559bbyyj6b3dztyyyyp2mg6sgmmn5d/T/tmpF1VInL/`

If I replace this with code like is in the current released version:

```
        base_name = self._tar_name(model_name, project, include_extension=False)
        tar_name = shutil.make_archive(base_name, 'gztar',
                                       root_dir=model_directory,
                                       base_dir=".")
```

The contents of the tar file are as I would expect:

```
./
./training_data.json
./intent_classifier_sklearn.pkl
./metadata.json
./entity_synonyms.json
./regex_featurizer.json
./crf_model.pkl
```

**Content of configuration file** (if used & relevant):
```json

```


Changed files:
rasa_nlu/persistor.py

diff --git a/rasa_nlu/persistor.py b/rasa_nlu/persistor.py
index e94f0e26231..d53eefee6c6 100644
--- a/rasa_nlu/persistor.py
+++ b/rasa_nlu/persistor.py
@@ -89,9 +89,10 @@ class Persistor(object):
 
         dirpath = tempfile.mkdtemp()
         base_name = self._tar_name(model_name, project, include_extension=False)
-        tar_name = shutil.make_archive(base_name, 'gztar',
+        tar_name = shutil.make_archive(os.path.join(dirpath, base_name),
+                                       'gztar',
                                        root_dir=model_directory,
-                                       base_dir=dirpath)
+                                       base_dir=".")
         file_key = os.path.basename(tar_name)
         return file_key, tar_name
Repository: rasahq/rasa
Issue: No project found error

**Issue**:
The current parse() implementation in data_router.py is that if a project is not found in project_store it loads it from project directory.

However _list_projects() return list of project names with absolute path:
def _list_projects(path):
        """List the projects in the path, ignoring hidden directories."""
        return [fn
                for fn in glob.glob(os.path.join(path, '*'))
                if os.path.isdir(fn)]

and since user passes only project name (ex: http://localhost:5000/parse?q=hi&project=project1)

so due to this project name is not matched even if the project is present in the directory

        if project not in self.project_store:
            projects = self._list_projects(self.config['path']) // returns ['/absolute-path/projects/project1']
            if project not in projects: // does not match as project = project1
                raise InvalidProjectError("No project found with name '{}'.".format(project))

This is for the case when rasa server is already running and user puts a pre-trained project from another directory to current project directory

Changed files:
rasa_nlu/data_router.py

diff --git a/rasa_nlu/data_router.py b/rasa_nlu/data_router.py
index d6691f716ed..ff66e6d7b4d 100644
--- a/rasa_nlu/data_router.py
+++ b/rasa_nlu/data_router.py
@@ -170,7 +170,7 @@ class DataRouter(object):
     @staticmethod
     def _list_projects(path):
         """List the projects in the path, ignoring hidden directories."""
-        return [fn
+        return [os.path.basename(fn)
                 for fn in glob.glob(os.path.join(path, '*'))
                 if os.path.isdir(fn)]
Repository: rasahq/rasa
Issue: ascii-error on train-endpoint

<!-- If you don't know your rasa NLU version, here is some help: https://goo.gl/g9QQg2. If you are creating a feature request, feel free to remove all the system information stuff. --> 

**rasa NLU version**: `0.9.1`

**Used backend / pipeline** (`mitie`, `spacy_sklearn`, ...): `spacy_sklearn`

**Operating system** (windows, osx, ...): `osx`

**Issue**:
When I post a json-file with expressions with unicode characters (e.g. euro sign (€)) to the servers' /train endpoint, I get an "500 Internal Server Error" response and the server-logs say:
`UnicodeEncodeError: 'ascii' codec can't encode character u'\\u20ac' in position 72: ordinal not in range(128)`

My steps:
`expressions.json`:
```json
{
  "rasa_nlu_data": {
    "common_examples": [
      {
        "text": "50 €",
        "intent": "set_price",
        "entities": []
      }
    ]
  }
}
```
- `curl -XPOST localhost:5000/train -d @expressions.json`
```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>
```

**Content of configuration file** (if used & relevant):
```json

```


Changed files:
rasa_nlu/data_router.py

diff --git a/rasa_nlu/data_router.py b/rasa_nlu/data_router.py
index 83f1899449c..31d9b9213ca 100644
--- a/rasa_nlu/data_router.py
+++ b/rasa_nlu/data_router.py
@@ -14,6 +14,7 @@ import io
 
 from builtins import object
 from typing import Text
+from future.utils import PY3
 
 from concurrent.futures import ProcessPoolExecutor as ProcessPool
 from twisted.internet.defer import Deferred, maybeDeferred
@@ -216,8 +217,12 @@ class DataRouter(object):
         }
 
     def start_train_process(self, data, config_values):
-        f = tempfile.NamedTemporaryFile("w+", suffix="_training_data.json", delete=False)
-        f.write(data)
+        if PY3:
+            f = tempfile.NamedTemporaryFile("w+", suffix="_training_data.json", delete=False, encoding="utf-8")
+            f.write(data)
+        else:
+            f = tempfile.NamedTemporaryFile("w+", suffix="_training_data.json", delete=False)
+            f.write(data.encode("utf-8"))
         f.close()
         # TODO: fix config handling
         _config = self.config.as_dict()
Repository: rasahq/rasa
Issue: "No model found" error message when model was loaded correctly

<!-- THIS INFORMATION IS MANDATORY - YOUR ISSUE WILL BE CLOSED IF IT IS MISSING. If you don't know your Rasa version, use `rasa --version`. 
Please format any code or console output with three ticks ``` above and below.
If you are asking a usage question (e.g. "How do I do xyz") please post your question on https://forum.rasa.com instead -->

**Rasa version**: `1.1.6`

**Python version**: `3.7.4`

**Operating system** (windows, osx, ...): macOS Mojave

**Issue**:
After creating a new project using `rasa init --no-prompt`, and running `rasa shell`, the bot is loaded correctly and it can respond correctly to my messages. However, after I use the `/stop` command to quit, an error message appears saying that no model could be loaded.


**Error (including full traceback)**:
```shell
2019-07-15 15:41:56 INFO     root  - Connecting to channel 'cmdline' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.
2019-07-15 15:41:56 INFO     root  - Starting Rasa Core server on http://localhost:5005
Bot loaded. Type a message and press enter (use '/stop' to exit):
Your input ->  hello
Hey! How are you?
Your input ->  /stop
2019-07-15 15:42:03 INFO     root  - Killing Sanic server now.

No model found. You have three options to provide a model:
1. Configure a model server in the endpoint configuration and provide the configuration via '--endpoints'.
2. Specify a remote storage via '--remote-storage' to load the model from.
3. Train a model before running the server using `rasa train` and use '--model' to provide the model path.
For more information check https://rasa.com/docs/rasa/user-guide/running-the-server/.
```

**Command or request that led to error**:
```
rasa shell
```

Changed files:
rasa/cli/run.py

diff --git a/rasa/cli/run.py b/rasa/cli/run.py
index 8c45b14aaac..10c81e0b51b 100644
--- a/rasa/cli/run.py
+++ b/rasa/cli/run.py
@@ -98,12 +98,14 @@ def run(args: argparse.Namespace):
     # start server if remote storage is configured
     if args.remote_storage is not None:
         rasa.run(**vars(args))
+        return
 
     # start server if model server is configured
     endpoints = AvailableEndpoints.read_endpoints(args.endpoints)
     model_server = endpoints.model if endpoints and endpoints.model else None
     if model_server is not None:
         rasa.run(**vars(args))
+        return
 
     # start server if local model found
     args.model = _validate_model_path(args.model, "model", DEFAULT_MODELS_PATH)
@@ -115,6 +117,7 @@ def run(args: argparse.Namespace):
 
     if local_model_set:
         rasa.run(**vars(args))
+        return
 
     print_error(
         "No model found. You have three options to provide a model:\\n"
Repository: rasahq/rasa
Issue: Rule policy consumes a lot of CPU at inference time

### Rasa Open Source version

2.8.21

### Rasa SDK version

 _No response_ 

### Rasa X version

 _No response_ 

### Python version

3.8

### What operating system are you using?

Linux

### What happened?

Rule Policy consumes a lot of CPU cycles when there are a lot of rules

### Command / Request

Run this [bot](https://github.com/RasaHQ/rule_policy_spike_cpu).

### Relevant log output

 _No response_

Changed files:
rasa/core/policies/rule_policy.py

diff --git a/rasa/core/policies/rule_policy.py b/rasa/core/policies/rule_policy.py
index 815bcd2f58b..7e24676f0bd 100644
--- a/rasa/core/policies/rule_policy.py
+++ b/rasa/core/policies/rule_policy.py
@@ -835,7 +835,7 @@ class RulePolicy(MemoizationPolicy):
     @staticmethod
     # This function is called a lot (e.g. for checking contradictions) so we cache
     # its results.
-    @functools.lru_cache(maxsize=1000)
+    @functools.lru_cache(maxsize=100000)
     def _rule_key_to_state(rule_key: Text) -> List[State]:
         return json.loads(rule_key)
Repository: rasahq/rasa
Issue: Text from telegram custom json not saved to the tracker store

<!-- THIS INFORMATION IS MANDATORY - YOUR ISSUE WILL BE CLOSED IF IT IS MISSING. If you don't know your Rasa version, use `rasa --version`. 
Please format any code or console output with three ticks ``` above and below.
If you are asking a usage question (e.g. "How do I do xyz") please post your question on https://forum.rasa.com instead -->

**Rasa version**: 1.3.3

**Rasa X version** (if used & relevant):

**Python version**:

**Operating system** (windows, osx, ...):

**Issue**: 
I send a markdown message in telegram with `utter_custom_json`:
```python
dispatcher.utter_custom_json({
    "text": "*hello world*",
    "parse_mode": 'Markdown',
})
```
But only `parse_mode` field is saved in tracker store:
```python
{"data":
    {
        "attachment": None,
        "buttons": None,
        "custom": {"parse_mode": "Markdown"},
        "elements": None,
        "image": None,
        "quick_replies": None
    }
}
```



**Error (including full traceback)**:
```

```

**Command or request that led to error**:
```

```

**Content of configuration file (config.yml)** (if relevant):
```yml

```

**Content of domain file (domain.yml)** (if relevant):
```yml

```


Changed files:
rasa/core/channels/telegram.py

diff --git a/rasa/core/channels/telegram.py b/rasa/core/channels/telegram.py
index 035dcd7c6d2..cdacb4afea8 100644
--- a/rasa/core/channels/telegram.py
+++ b/rasa/core/channels/telegram.py
@@ -1,4 +1,5 @@
 import logging
+from copy import deepcopy
 from sanic import Blueprint, response
 from sanic.request import Request
 from telegram import (
@@ -94,6 +95,8 @@ class TelegramOutput(Bot, OutputChannel):
     async def send_custom_json(
         self, recipient_id: Text, json_message: Dict[Text, Any], **kwargs: Any
     ) -> None:
+        json_message = deepcopy(json_message)
+
         recipient_id = json_message.pop("chat_id", recipient_id)
 
         send_functions = {
Repository: rasahq/rasa
Issue: rasa test core not working for stories in a folder

<!-- THIS INFORMATION IS MANDATORY - YOUR ISSUE WILL BE CLOSED IF IT IS MISSING. If you don't know your Rasa version, use `rasa --version`. 
Please format any code or console output with three ticks ``` above and below.
If you are asking a usage question (e.g. "How do I do xyz") please post your question on https://forum.rasa.com instead -->

**Rasa version**:
Current ```master```
**Rasa SDK version** (if used & relevant):
N/A
**Rasa X version** (if used & relevant):
N/A
**Python version**:

**Operating system** (windows, osx, ...):

**Issue**:
`rasa test core` doesn't work when the stories are in a subfolder, e.g., `rasa test core --stories data/core` on `rasa-demo`
In this case, it finds 0 test stories. 

(My suspicion is that it comes from `rasa.data.get_test_directory`)

**Error (including full traceback)**:
```

```

**Command or request that led to error**:
```
rasa test core --stories data/core
```

in ```rasa-demo```

**Content of configuration file (config.yml)** (if relevant):
```yml

```

**Content of domain file (domain.yml)** (if relevant):
```yml

```


Changed files:
rasa/cli/test.py, rasa/shared/data.py

diff --git a/rasa/cli/test.py b/rasa/cli/test.py
index d866c3ae392..8858ed7d793 100644
--- a/rasa/cli/test.py
+++ b/rasa/cli/test.py
@@ -70,7 +70,11 @@ def run_core_test(args: argparse.Namespace) -> None:
     stories = rasa.cli.utils.get_validated_path(
         args.stories, "stories", DEFAULT_DATA_PATH
     )
-    stories = rasa.shared.data.get_test_directory(stories)
+    if args.e2e:
+        stories = rasa.shared.data.get_test_directory(stories)
+    else:
+        stories = rasa.shared.data.get_core_directory(stories)
+
     output = args.out or DEFAULT_RESULTS_PATH
     args.errors = not args.no_errors
 
diff --git a/rasa/shared/data.py b/rasa/shared/data.py
index 7b30c100733..8872943b7dc 100644
--- a/rasa/shared/data.py
+++ b/rasa/shared/data.py
@@ -238,7 +238,7 @@ def is_test_stories_file(file_path: Text) -> bool:
         MarkdownStoryReader,
     )
 
-    return YAMLStoryReader.is_yaml_story_file(
+    return YAMLStoryReader.is_yaml_test_stories_file(
         file_path
     ) or MarkdownStoryReader.is_markdown_test_stories_file(file_path)
Repository: rasahq/rasa
Issue: RegexInterpreter Used When NLU Model Not Present is Causing Intent Prediction Issues

 _Rasa version_ : 2.7.1

 _Operating system_ (windows, osx, ...): Linux

 _Issue_ : When the NLU model is still being loaded into memory, [this case for the NLU interpreter object| [https://github.com/RasaHQ/rasa/blob/main/rasa/core/interpreter.py#L32](https://github.com/RasaHQ/rasa/blob/main/rasa/core/interpreter.py#L32)] will not apply and the RegexInterpreter gets used as the default. As a result, the user's raw input text gets predicted as the intent, e.g. `intent=Intent(name=Hello I needed help to follow up on my extension I needed for my bill, confidence=1.0)`.

This is causing problems for customers that are using production data to analyze intent distribution since the predicted intent ends up being assigned as the raw text.

Changed files:
rasa/core/interpreter.py

diff --git a/rasa/core/interpreter.py b/rasa/core/interpreter.py
index fdd764b7e5f..c368be415a2 100644
--- a/rasa/core/interpreter.py
+++ b/rasa/core/interpreter.py
@@ -170,10 +170,11 @@ def _create_from_endpoint_config(
     endpoint_config: Optional[EndpointConfig],
 ) -> rasa.shared.nlu.interpreter.NaturalLanguageInterpreter:
     """Instantiate a natural language interpreter based on its configuration."""
-
-    if endpoint_config is None:
-        return rasa.shared.nlu.interpreter.RegexInterpreter()
-    elif endpoint_config.type is None or endpoint_config.type.lower() == "http":
+    if (
+        endpoint_config is None
+        or endpoint_config.type is None
+        or endpoint_config.type.lower() == "http"
+    ):
         return RasaNLUHttpInterpreter(endpoint_config=endpoint_config)
     else:
         return _load_from_module_name_in_endpoint_config(endpoint_config)
@@ -183,15 +184,20 @@ def _load_from_module_name_in_endpoint_config(
     endpoint_config: EndpointConfig,
 ) -> rasa.shared.nlu.interpreter.NaturalLanguageInterpreter:
     """Instantiate an event channel based on its class name."""
-
     try:
         nlu_interpreter_class = rasa.shared.utils.common.class_from_module_path(
             endpoint_config.type
         )
         return nlu_interpreter_class(endpoint_config=endpoint_config)
     except (AttributeError, ImportError) as e:
-        raise Exception(
-            f"Could not find a class based on the module path "
-            f"'{endpoint_config.type}'. Failed to create a "
-            f"`NaturalLanguageInterpreter` instance. Error: {e}"
-        )
+        if endpoint_config:
+            raise Exception(
+                f"Could not find a class based on the module path "
+                f"'{endpoint_config.type}'. Failed to create a "
+                f"`NaturalLanguageInterpreter` instance. Error: {e}"
+            )
+        else:
+            raise Exception(
+                f"Endpoint configuration not found. Failed to create a "
+                f"`NaturalLanguageInterpreter` instance. Error: {e}"
+            )
Repository: pulumi/pulumi
Issue: Function serialization broken in NodeJS 19.2

### Update on issue

If you encounter this error, update to Node 19.4 or newer.

---------

### What happened?

When opening a new PR unrelated to the Node SDK, tests related to function serialization fail due to a missing internal property `[[Scopes]]`

### Steps to reproduce

Run Node SDK unit tests in CI

### Expected Behavior

If no code changes have been made, no tests should fail.

### Actual Behavior

Tests are failing

### Output of `pulumi about`

Not _terribly_ relevant, but:

CLI          
Version      3.46.2-dev.0
Go Version   go1.19.2
Go Compiler  gc

Host     
OS       ubuntu
Version  20.04
Arch     x86_64

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/kpitzen
User           kpitzen
Organizations  kpitzen, EpicGames, pulumi

### Additional context

Here is the original failing job:
https://github.com/pulumi/pulumi/actions/runs/3577856744/jobs/6017440059

And a no-op job with _only_ a README change:
https://github.com/pulumi/pulumi/actions/runs/3578273088/jobs/6018337627

The failing branch of code ends here:
https://github.com/pulumi/pulumi/blob/e43e98e5a7abadca7ab04c5f6bf9511b2dcb0478/sdk/nodejs/runtime/closure/v8_v11andHigher.ts#L59

### Contributing

Vote on this issue by adding a 👍 reaction. 
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already). 


Changed files:
scripts/get-job-matrix.py

diff --git a/scripts/get-job-matrix.py b/scripts/get-job-matrix.py
index cac33ce89..caa6260d4 100755
--- a/scripts/get-job-matrix.py
+++ b/scripts/get-job-matrix.py
@@ -103,7 +103,7 @@ CURRENT_VERSION_SET = {
     "name": "current",
     "dotnet": "7",
     "go": "1.19.x",
-    "nodejs": "19.1",
+    "nodejs": "19.x",
     "python": "3.10.x",
 }
Repository: pulumi/pulumi
Issue: `pulumi preview` hangs on failure in chained Outputs

### What happened?

With a particular sequence of chained Outputs, a failure can cause `pulumi preview` (or `up`) to hang rather than crash with a traceback.

### Steps to reproduce

```bash
pulumi new aws-python
```

```python
# __main__.py
import pulumi
import pulumi_aws as aws

output = pulumi.Output.from_input("dummy")
# This fails as the given attribute does not exist.
# Removing this line produces a valid configuration
# that succeeds on `pulumi preview`.
output = output.apply(lambda x: x.bad_attribute)

bucket = aws.s3.Bucket("my-bucket", tags={"dummy": output})
# This line is required to induce the failure.
# Removing it causes `pulumi preview` to crash as expected.
bucket = pulumi.Output.from_input(bucket)

aws.s3.Bucket("my-other-bucket", tags={"dummy": bucket.arn})

# This line is required to induce the failure.
# Removing it causes `pulumi preview` to crash as expected.
aws.get_region()
```

```
pulumi preview
```

### Expected Behavior

The preview crashes with a traceback ending in `AttributeError: 'str' object has no attribute 'bad_attribute'`.

### Actual Behavior

The preview hangs indefinitely until killed via Ctrl+C.

### Versions used

```
CLI
Version      3.36.0
Go Version   go1.17.12
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.10.0
python  unknown

Host
OS       Microsoft Windows 10 Pro
Version  10.0.19043 Build 19043
Arch     x86_64

This project is written in python: executable='C:\\Program Files\\Python39\\python.exe' version='3.9.5'

Current Stack: dev

Found no resources associated with dev

Found no pending operations associated with dev

Dependencies:
NAME        VERSION
pip         22.1.2
pulumi-aws  5.10.0
setuptools  63.2.0
wheel       0.37.1
```

### Additional context

_No response_

### Contributing

Vote on this issue by adding a 👍 reaction. 
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already). 


Changed files:
sdk/python/lib/pulumi/runtime/stack.py

diff --git a/sdk/python/lib/pulumi/runtime/stack.py b/sdk/python/lib/pulumi/runtime/stack.py
index b78924185..2b22ea405 100644
--- a/sdk/python/lib/pulumi/runtime/stack.py
+++ b/sdk/python/lib/pulumi/runtime/stack.py
@@ -67,6 +67,8 @@ async def wait_for_rpcs(await_all_outstanding_tasks=True) -> None:
         # We await each RPC in turn so that this loop will actually block rather than busy-wait.
         while len(RPC_MANAGER.rpcs) > 0:
             await asyncio.sleep(0)
+            if RPC_MANAGER.unhandled_exception is not None:
+                break
             log.debug(
                 f"waiting for quiescence; {len(RPC_MANAGER.rpcs)} RPCs outstanding"
             )