internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: meltano/meltano

Issue:
bug: Cloud CLI logs auth token at info level
### Meltano Version

cloud branch

### Python Version

NA

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

N/A

### Description

Running `meltano cloud login` results in the input shown below. Running `meltano-cloud login` does not.

A good resolution to this would probably be to figure out what is logging these HTTP requests, and silence those log messages. My guess is that it has to do with the recent change to use `aiohttp` instead of Flask for the local auth server.

### Code

```python
Logging in to Meltano Cloud.
You will be directed to a web browser to complete login.
If a web browser does not open, open the following link:
https://auth.meltano.cloud/oauth2/authorize?client_id=45rpn5ep3g4qjut8jd3s4iq872&response_type=token&scope=email+openid+profile&redirect_uri=http%3A%2F%2Flocalhost%3A9999
2023-04-04T16:09:25.658362Z [info     ] 127.0.0.1 [04/Apr/2023:16:09:25 +0000] "GET / HTTP/1.1" 200 236 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0"
2023-04-04T16:09:25.780667Z [info     ] 127.0.0.1 [04/Apr/2023:16:09:25 +0000] "GET /tokens?access_token=<redacted>&token_type=Bearer&expires_in=28800 HTTP/1.1" 204 99 "http://localhost:9999/" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0"
```



Discussion:

Resolving patch:
diff --git a/src/cloud-cli/meltano/cloud/api/auth/auth.py b/src/cloud-cli/meltano/cloud/api/auth/auth.py
--- a/src/cloud-cli/meltano/cloud/api/auth/auth.py
+++ b/src/cloud-cli/meltano/cloud/api/auth/auth.py
@@ -124,7 +124,7 @@ async def handle_logout(_):
                 web.get("/logout", handle_logout),
             ),
         )
-        runner = web.AppRunner(app)
+        runner = web.AppRunner(app, access_log=None)
         await runner.setup()
         site = web.TCPSite(runner, "localhost", self.config.auth_callback_port)
         await site.start()


Test patch:
Repository: meltano/meltano

Issue:
bug: When meltano.yml is empty, no error message is printed. Rather, it just mentions to reach out to community
### Meltano Version

2.19.0

### Python Version

3.9

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

Windows - WSL(Ubuntu)

### Description

when `meltano.yml` is empty, `cli`(`meltano.cli.__init__.py: 105`) raises `EmptyMeltanoFileException` exception whenever we try to run any command such as `meltano add` or `meltano ui`. But, since there's no exception message, it just prints the troubleshooting message and blank lines as follows

```
Need help fixing this problem? Visit http://melta.no/ for troubleshooting steps, or to
join our friendly Slack community.

```


### Code

_No response_


Discussion:

Resolving patch:
diff --git a/src/meltano/core/error.py b/src/meltano/core/error.py
--- a/src/meltano/core/error.py
+++ b/src/meltano/core/error.py
@@ -100,9 +100,15 @@ class PluginInstallWarning(Exception):
     """Exception for when a plugin optional optional step fails to install."""
 
 
-class EmptyMeltanoFileException(Exception):
+class EmptyMeltanoFileException(MeltanoError):
     """Exception for empty meltano.yml file."""
 
+    def __init__(self) -> None:
+        """Instantiate the error."""
+        reason = "Your meltano.yml file is empty"
+        instruction = "Please update your meltano file with a valid configuration"
+        super().__init__(reason, instruction)
+
 
 class MeltanoConfigurationError(MeltanoError):
     """Exception for when Meltano is inproperly configured."""


Test patch:
Repository: meltano/meltano

Issue:
bug: Cloud CLI schedule help has same text for describe and list
### Meltano Version

2.18.0

### Python Version

3.10

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

Mac M1

### Description

```
❯ meltano-cloud schedule --help
Usage: meltano-cloud schedule [OPTIONS] COMMAND [ARGS]...

  Interact with Meltano Cloud project schedules.

Options:
  --deployment TEXT  The name of the Meltano Cloud deployment the schedule
                     belongs to.
  --schedule TEXT    The name of a schedule within the specified deployment.
  --help             Show this message and exit.

Commands:
  describe  List Meltano Cloud schedules.
  disable   Disable a Meltano Cloud schedule.
  enable    Enable a Meltano Cloud schedule.
  list      List Meltano Cloud schedules.
```

`describe` and `list` say the same thing

### Code

_No response_


Discussion:

Resolving patch:
diff --git a/src/cloud-cli/meltano/cloud/cli/schedule.py b/src/cloud-cli/meltano/cloud/cli/schedule.py
--- a/src/cloud-cli/meltano/cloud/cli/schedule.py
+++ b/src/cloud-cli/meltano/cloud/cli/schedule.py
@@ -380,7 +380,7 @@ async def describe_schedule(
     only_upcoming: bool,
     num_upcoming: int,
 ) -> None:
-    """List Meltano Cloud schedules."""
+    """Describe a Meltano Cloud schedules & list upcoming scheduled runs."""
     schedule = await _get_schedule(
         config=context.config,
         deployment_name=context.deployment,


Test patch:
Repository: meltano/meltano

Issue:
bug: Cloud project ID of `00000000000000000000000000` is used as real ID
### Meltano Version

cloud branch

### Python Version

NA

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

N/A

### Description

[Context on Slack.](https://meltano.slack.com/archives/C04SHQJB95F/p1686101768535459?thread_ts=1686096202.419359&cid=C04SHQJB95F)

[Datadog logs for the provisioner API error.](https://app.datadoghq.com/logs?query=service%3Aprovisioner-function-e012747%20&cols=host%2Cservice&event=AgAAAYiTLKwO9bi1IQAAAAAAAAAYAAAAAEFZaVRMTkEyQUFDdlZ2eVphdGk2SEFBRAAAACQAAAAAMDE4ODkzMmYtNDcwNy00YWY4LTgzM2ItNTY4MmQ5MjEwMGFm&index=%2A&messageDisplay=inline&saved-view-id=1860006&stream_sort=desc&viz=stream&from_ts=1686087280625&to_ts=1686101680625&live=true)

The project ID of `00000000000000000000000000` should never be used as a real Cloud project ID. It is merely a placeholder that is returned as part of the custom Cognito attribute during login because historically a real project ID was obtained via Cognito.

If a project ID of `00000000000000000000000000` is found, it should be replaced by `None` (i.e. `null` in the config JSON document), rather than used for any command.

### Code

_No response_


Discussion:

Resolving patch:
diff --git a/src/cloud-cli/meltano/cloud/api/config.py b/src/cloud-cli/meltano/cloud/api/config.py
--- a/src/cloud-cli/meltano/cloud/api/config.py
+++ b/src/cloud-cli/meltano/cloud/api/config.py
@@ -184,7 +184,11 @@ def internal_project_ids(self) -> set[str]:
         Returns:
             The internal project IDs found in the ID token.
         """
-        return {perm.split("::")[1] for perm in self._trks_and_pids}
+        # NOTE: The ID 00000000000000000000000000 is used as a placeholder
+        # within the Cognito custom attribute trk_and_pid, because the trk
+        # part is the only significant part.
+        ignore_ids = {"00000000000000000000000000"}
+        return {perm.split("::")[1] for perm in self._trks_and_pids} - ignore_ids
 
     @property
     def internal_project_id(self) -> str:


Test patch:
Repository: meltano/meltano

Issue:
bug: confusing error message when running `meltano cloud project use` with no projects
### Meltano Version

cloud branch

### Python Version

NA

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

N/A

### Description

Current behaviour:

```
(meltano310) will ~/meltano/meltano (cloud) $ meltano cloud project use
Need help fixing this problem? Visit http://melta.no/ for troubleshooting steps, or to
join our friendly Slack community.

A list of choices needs to be provided.
```

Expected behaviour:

```
(meltano310) will ~/meltano/meltano (cloud) $ meltano cloud project use
Need help fixing this problem? Visit http://melta.no/ for troubleshooting steps, or to
join our friendly Slack community.

No Meltano Cloud projects available to use. Please create a project before running 'meltano cloud project use'.
```

### Code

_No response_


Discussion:

Resolving patch:
diff --git a/src/cloud-cli/meltano/cloud/cli/project.py b/src/cloud-cli/meltano/cloud/cli/project.py
--- a/src/cloud-cli/meltano/cloud/cli/project.py
+++ b/src/cloud-cli/meltano/cloud/cli/project.py
@@ -242,6 +242,11 @@ def prompt_for_value(self, ctx: click.Context) -> t.Any:
             ),
             {"project_name": None},
         )["project_name"]
+        if not context.projects:
+            raise click.ClickException(
+                "No Meltano Cloud projects available to use. Please create a "
+                "project before running 'meltano cloud project use'.",
+            )
         return questionary.select(
             message="",
             qmark="Use Meltano Cloud project",


Test patch:
Repository: meltano/meltano

Issue:
CLI: "Did you mean?" prompt if command doesn't exist
```
% meltano cloud invoke evidence:dev
Error. `meltano cloud invoke` is not a valid command. Did you mean `meltano invoke`?
```

```
% meltano status
Error. `meltano status` is not a valid command. Did you mean `meltano cloud status`?
```

```
% meltano login
Error. `meltano login` is not a valid command. Did you mean `meltano cloud login`?
```


Discussion:
This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the `evergreen` label, or request that it be added.

This would still be great. How hard is something like this to implement @WillDaSilva ?

Resolving patch:
diff --git a/src/meltano/cli/utils.py b/src/meltano/cli/utils.py
--- a/src/meltano/cli/utils.py
+++ b/src/meltano/cli/utils.py
@@ -11,6 +11,7 @@
 
 import click
 from click_default_group import DefaultGroup
+from click_didyoumean import DYMGroup
 
 from meltano.core.error import MeltanoConfigurationError
 from meltano.core.logging import setup_logging
@@ -612,11 +613,11 @@ def invoke(self, ctx: click.Context):
         super().invoke(ctx)
 
 
-class InstrumentedDefaultGroup(InstrumentedGroupMixin, DefaultGroup):
+class InstrumentedDefaultGroup(InstrumentedGroupMixin, DefaultGroup, DYMGroup):
     """Click group with telemetry instrumentation and a default command."""
 
 
-class InstrumentedGroup(InstrumentedGroupMixin, click.Group):
+class InstrumentedGroup(InstrumentedGroupMixin, DYMGroup):
     """Click group with telemetry instrumentation."""
 
 


Test patch:
Repository: meltano/meltano

Issue:
bug: Replace usage of deprecated `locale.getdefaultlocale`
### Meltano Version

2.20.0

### Python Version

3.11

### Bug scope

Other

### Operating System

NA

### Description

The function `locale.getdefaultlocale` is deprecated since version 3.11, will be removed in version 3.13. It is recommended to use `locale.getlocale` instead.

An explanation: https://github.com/python/cpython/issues/90817#issuecomment-1093944235

https://github.com/meltano/meltano/blob/b3a550cd2ae953b39e4b188ebd96abb77c435abf/src/meltano/core/tracking/tracker.py#L136

### Code

_No response_


Discussion:

Resolving patch:
diff --git a/src/meltano/core/tracking/tracker.py b/src/meltano/core/tracking/tracker.py
--- a/src/meltano/core/tracking/tracker.py
+++ b/src/meltano/core/tracking/tracker.py
@@ -138,7 +138,7 @@ def __init__(  # noqa: WPS210 - too many local variables
                 app_id="meltano",
                 emitters=emitters,
             )
-            self.snowplow_tracker.subject.set_lang(locale.getdefaultlocale()[0])
+            self.snowplow_tracker.subject.set_lang(locale.getlocale()[0])
             self.snowplow_tracker.subject.set_timezone(self.timezone_name)
             self.setup_exit_event()
         else:


Test patch:
Repository: meltano/meltano

Issue:
EL log files should not contain secrets
The full database URI is shown in debug logs:

```console
$ export MELTANO_CLI_LOG_LEVEL=debug
$ meltano invoke my-tap
2022-09-07T16:34:57.234152Z [info     ] Environment 'dev' is active
2022-09-07T16:34:57.338859Z [debug    ] Creating engine <meltano.core.project.Project object at 0x10e9702e0>@postgresql://***********
```

Where I redacted the username, password, etc. from the Postgres URI.

The full environment variables mapping log message may also contain secrets:

```console
2022-09-07T16:35:01.443284Z [debug    ] Env: {'USER': ...
```

_Raised by Tomas B in Office Hours._



Discussion:
This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the `evergreen` label, or request that it be added.

Still relevant

Resolving patch:
diff --git a/src/meltano/core/db.py b/src/meltano/core/db.py
--- a/src/meltano/core/db.py
+++ b/src/meltano/core/db.py
@@ -4,6 +4,7 @@
 
 import logging
 import time
+from urllib.parse import urlparse
 
 from sqlalchemy import create_engine
 from sqlalchemy.engine import Connection, Engine
@@ -73,13 +74,27 @@ def project_engine(
     if existing_engine:
         return existing_engine
 
-    engine_uri = project.settings.get("database_uri")
-    logging.debug(f"Creating engine '{project}@{engine_uri}'")
+    database_uri = project.settings.get("database_uri")
+    parsed_db_uri = urlparse(database_uri)
+    sanitized_db_uri = parsed_db_uri._replace(  # noqa: WPS437
+        netloc=(
+            f"{parsed_db_uri.username}:********@"  # user:pass auth case
+            if parsed_db_uri.password
+            else "********@"  # token auth case
+            if parsed_db_uri.username
+            else ""  # no auth case
+        )
+        + (parsed_db_uri.hostname or ""),
+    ).geturl()
+    logging.debug(
+        f"Creating DB engine for project at {str(project.root)!r} "
+        f"with DB URI {sanitized_db_uri!r}",
+    )
 
-    if engine_uri is None:
+    if database_uri is None:
         raise NullConnectionStringError
 
-    engine = create_engine(engine_uri, poolclass=NullPool)
+    engine = create_engine(database_uri, poolclass=NullPool)
 
     # Connect to the database to ensure it is available.
     connect(


Test patch:
Repository: meltano/meltano

Issue:
bug: Select doesn't show % characters
### Meltano Version

3.1.0

### Python Version

3.10

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

Ubuntu 20.04 (WSL)

### Description

I have a tap with properties that have a "%" in the name 

Example

```
visch@DESKTOP-9BDPA9T:~/git/meltano-projects/ait-mssql-snowflake$ meltano select tap-mssql --list
2023-10-27T15:03:27.475043Z [info     ] The default environment 'dev' will be ignored for `meltano select`. To configure a specific environment, please use the option `--environment=<environment name>`.
Legend:
        selected
        excluded
        automatic

Enabled patterns:
        *test*.*

Selected attributes:
        [selected ] dbo-test.APN
        [selected ] dbo-test.test
        [selected ] dbo-test.testcolum
 ```
 
 
 Meltano works properly with the tap and I get output like
 
 ```
 {"type": "RECORD", "stream": "dbo-test", "record": {"testcolum": "col1", "APN % Issue": "col3", "test%column": "col2"}, "version": 1698418991197, "time_extracted": "2023-10-27T15:03:11.205010Z"}
 ```
 
 So it looks to just be a UI thing
 

### Code

_No response_


Discussion:
https://github.com/meltano/meltano/blob/main/src/meltano/core/plugin/singer/catalog.py#L250 looks to be the culprit as if you swap this function to just return `path` things work as expected. More to this than you'd think so I'm going to leave this here!
@edgarrmondragon may be worth taking a look at this one.

Resolving patch:
diff --git a/src/meltano/core/plugin/singer/catalog.py b/src/meltano/core/plugin/singer/catalog.py
--- a/src/meltano/core/plugin/singer/catalog.py
+++ b/src/meltano/core/plugin/singer/catalog.py
@@ -247,7 +247,7 @@ def path_property(path: str) -> str:
       stream[0].properties.list_items.properties.account → list_items.account
       stream[0].properties.name                          → name
     """
-    prop_regex = r"properties\.([\w\[\]\d]+)+"
+    prop_regex = r"properties\.([^.]+)+"
     components = re.findall(prop_regex, path)
     return ".".join(components)
 


Test patch:
diff --git a/tests/meltano/core/plugin/singer/test_catalog.py b/tests/meltano/core/plugin/singer/test_catalog.py
--- a/tests/meltano/core/plugin/singer/test_catalog.py
+++ b/tests/meltano/core/plugin/singer/test_catalog.py
@@ -455,6 +455,11 @@ def select_all_executor():
         ("stream[0].properties.master.properties.details", "master.details"),
         ("stream[2].properties.name", "name"),
         ("stream[10].properties.list[2].properties.name", "list[2].name"),
+        ("stream[0].properties.properties.properties.prop_1", "properties.prop_1"),
+        (
+            "stream[0].properties.I HAVE SPACES.properties.SPECIAL CHAR %",
+            "I HAVE SPACES.SPECIAL CHAR %",
+        ),
     ),
 )
 def test_path_property(path, prop):
Repository: meltano/meltano

Issue:
bug: Interactive config prompt should indicate when you're typing a redacted value
### Meltano Version

3.1.0

### Python Version

NA

### Bug scope

CLI (options, error messages, logging, etc.)

### Operating System

NA

### Description

`New value` should probably be `New value (redacted)`:

https://github.com/meltano/meltano/blob/eee71ac0209071bc7174feff1ea26329808abe2a/src/meltano/cli/interactive/config.py#L242-L248

### Code

_No response_


Discussion:
 @edgarrmondragon  can you assign me this issue?
Done @abastola0!

Resolving patch:
diff --git a/src/meltano/cli/interactive/config.py b/src/meltano/cli/interactive/config.py
--- a/src/meltano/cli/interactive/config.py
+++ b/src/meltano/cli/interactive/config.py
@@ -240,7 +240,7 @@ def _value_prompt(config_metadata):
         if config_metadata["setting"].kind != SettingKind.OPTIONS:
             return (
                 click.prompt(
-                    "New value",
+                    "New value (redacted)",
                     default="",
                     show_default=False,
                     hide_input=True,


Test patch:
Repository: meltano/meltano

Issue:
Ruff: Enable flake8-pie, flake8-quotes and flake8-debugger 
Meta Issue: #7383

Ruff rule classes to enable:
"PIE", # flake8-pie
"Q",   # flake8-quotes
"T10", # flake8-debugger


PS: I (@nkclemson ) will work on this meta issue one by one.


Discussion:

Resolving patch:
diff --git a/src/meltano/core/state_store/db.py b/src/meltano/core/state_store/db.py
--- a/src/meltano/core/state_store/db.py
+++ b/src/meltano/core/state_store/db.py
@@ -115,7 +115,7 @@ def acquire_lock(self, state_id):
         Args:
             state_id: the state_id to lock
         """
-        ...  # noqa: WPS428
+        # noqa: WPS428
 
     def release_lock(self, state_id):
         """Release the lock for the given job's state.
@@ -126,4 +126,4 @@ def release_lock(self, state_id):
         Args:
             state_id: the state_id to unlock
         """
-        ...  # noqa: WPS428
+        # noqa: WPS428
diff --git a/src/meltano/core/state_store/filesystem.py b/src/meltano/core/state_store/filesystem.py
--- a/src/meltano/core/state_store/filesystem.py
+++ b/src/meltano/core/state_store/filesystem.py
@@ -236,7 +236,6 @@ def create_state_id_dir_if_not_exists(self, state_id: str):
         Args:
             state_id: the state_id to create the dir/prefix for
         """
-        ...
 
     @contextmanager
     def acquire_lock(self, state_id: str, retry_seconds: int = 1) -> Iterator[None]:


Test patch:
diff --git a/tests/meltano/core/job/test_job.py b/tests/meltano/core/job/test_job.py
--- a/tests/meltano/core/job/test_job.py
+++ b/tests/meltano/core/job/test_job.py
@@ -30,7 +30,7 @@ def test_save(self, session):
         assert subject.id > 0
 
     def test_load(self, session):
-        for key in range(0, 10):
+        for key in range(10):
             session.add(self.sample_job({"key": key}))
 
         subjects = session.query(Job).filter_by(job_name="meltano:sample-elt")
Repository: Bitmessage/PyBitmessage

Issue:
OpenSSL not found on OS X 10.8
I tried to install OpenSSL via brew, but no effect. I exported needed PATH for it.

OpenSSL not found on OS X 10.8
I tried to install OpenSSL via brew, but no effect. I exported needed PATH for it.



Discussion:
Workaround: modify /pyelliptic/openssl.py to search for OpenSSL in /usr/local/opt/openssl/lib/libcrypto.dylib (brewed version).

I have the same issue about this. Any idea?

Workaround: modify /pyelliptic/openssl.py to search for OpenSSL in /usr/local/opt/openssl/lib/libcrypto.dylib (brewed version).

I have the same issue about this. Any idea?


Resolving patch:
diff --git a/src/pyelliptic/openssl.py b/src/pyelliptic/openssl.py
--- a/src/pyelliptic/openssl.py
+++ b/src/pyelliptic/openssl.py
@@ -415,17 +415,21 @@ def malloc(self, data, size):
             OpenSSL = _OpenSSL('libcrypto.dylib')
         except:
             try:
-                from os import path
-                lib_path = path.join(sys._MEIPASS, "libeay32.dll")
-                OpenSSL = _OpenSSL(lib_path)
+                # try homebrew installation
+                OpenSSL = _OpenSSL('/usr/local/opt/openssl/lib/libcrypto.dylib')
             except:
-                if 'linux' in sys.platform or 'darwin' in sys.platform:
-                    try:
-                        from ctypes.util import find_library
-                        OpenSSL = _OpenSSL(find_library('ssl'))
-                    except Exception, err:
-                        sys.stderr.write('(On Linux) Couldn\'t find and load the OpenSSL library. You must install it. If you believe that you already have it installed, this exception information might be of use:\n')
-                        from ctypes.util import find_library
-                        OpenSSL = _OpenSSL(find_library('ssl'))
-                else:
-                    raise Exception("Couldn't find and load the OpenSSL library. You must install it.")
+                try:
+                    from os import path
+                    lib_path = path.join(sys._MEIPASS, "libeay32.dll")
+                    OpenSSL = _OpenSSL(lib_path)
+                except:
+                    if 'linux' in sys.platform or 'darwin' in sys.platform:
+                        try:
+                            from ctypes.util import find_library
+                            OpenSSL = _OpenSSL(find_library('ssl'))
+                        except Exception, err:
+                            sys.stderr.write('(On Linux) Couldn\'t find and load the OpenSSL library. You must install it. If you believe that you already have it installed, this exception information might be of use:\n')
+                            from ctypes.util import find_library
+                            OpenSSL = _OpenSSL(find_library('ssl'))
+                    else:
+                        raise Exception("Couldn't find and load the OpenSSL library. You must install it.")


Test patch: