Repository: meltano/meltano

Issue:
Manifest integration test does not run in CI & expected output is incorrect
### Meltano Version

2.15.3

### Python Version

NA

### Bug scope

Other

### Operating System

N/A

### Description

The manifest integration test doesn't run in CI, since I forgot that each new integration test has to be manually added to the workflow rather than it automatically running all of them.

As a result of it not having been run prior to merging #7148, the expected manifest files it checks against contain errors.

### Code

_No response_


Discussion:

Resolving patch:
diff --git a/src/meltano/cli/compile.py b/src/meltano/cli/compile.py
--- a/src/meltano/cli/compile.py
+++ b/src/meltano/cli/compile.py
@@ -80,12 +80,8 @@ def compile(  # noqa: WPS125
             if environment is None
             else f"meltano-manifest.{environment.name}.json"
         )
-        manifest = Manifest(
-            project=project,
-            environment=environment,
-            path=path,
-            check_schema=lint,
-        )
+        project.refresh(environment=environment)
+        manifest = Manifest(project=project, path=path, check_schema=lint)
         try:
             with open(path, "w") as manifest_file:
                 json.dump(
diff --git a/src/meltano/core/manifest/manifest.py b/src/meltano/core/manifest/manifest.py
--- a/src/meltano/core/manifest/manifest.py
+++ b/src/meltano/core/manifest/manifest.py
@@ -22,7 +22,6 @@
 from typing_extensions import TypeAlias
 
 from meltano import __file__ as package_root_path
-from meltano.core.environment import Environment
 from meltano.core.manifest.jsonschema import meltano_config_env_locations
 from meltano.core.plugin.base import PluginType
 from meltano.core.plugin.project_plugin import ProjectPlugin
@@ -113,13 +112,7 @@ class YamlNoTimestampSafeLoader(
 class Manifest:  # noqa: WPS214
     """A complete unambiguous static representation of a Meltano project."""
 
-    def __init__(
-        self,
-        project: Project,
-        environment: Environment | None,
-        path: Path,
-        check_schema: bool,
-    ) -> None:
+    def __init__(self, project: Project, path: Path, check_schema: bool) -> None:
         """Initialize the manifest.
 
         This class does not write a manifest file. It merely generates the data
@@ -131,9 +124,6 @@ def __init__(
 
         Args:
             project: The Meltano project which this manifest describes.
-            environment: The Meltano environment which this manifest describes.
-                If `None`, then all data under the `environments` key in the
-                project files will be ignored by this manifest.
             path: The path the Manifest will be saved to - only used for
                 jsonschema validation failure error messages.
             check_schema: Whether the project files and generated manifest
@@ -142,7 +132,6 @@ def __init__(
         self.project = project
         self._project_root_str = str(self.project.root.resolve())
         self._meltano_file = self.project.meltanofile.read_text()
-        self.environment = environment
         self.path = path
         self.check_schema = check_schema
         with open(MANIFEST_SCHEMA_PATH) as manifest_schema_file:
@@ -341,7 +330,7 @@ def data(self) -> dict[str, Any]:
         manifest = self._project_files
 
         # Remove all environments other than the one this manifest is for:
-        if self.environment is None:
+        if self.project.environment is None:
             # We use a mock environment here because the rest of the code
             # expects there to be exactly one environment. It is omitted from
             # the final output, and during processing it only affects things if
@@ -351,7 +340,7 @@ def data(self) -> dict[str, Any]:
             manifest["environments"] = [
                 x
                 for x in manifest["environments"]
-                if x["name"] == self.environment.name
+                if x["name"] == self.project.environment.name
             ]
 
         apply_scaffold(manifest, self._env_locations)


Test patch:
diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml
--- a/.github/workflows/integration_tests.yml
+++ b/.github/workflows/integration_tests.yml
@@ -37,6 +37,7 @@ jobs:
         - { integration_test: "meltano-state-s3", needs_postgres: false}
         - { integration_test: "meltano-state-local", needs_postgres: false}
         - { integration_test: "meltano-config", needs_postgres: false}
+        - { integration_test: "meltano-manifest", needs_postgres: false}
       fail-fast: false
 
     runs-on: ubuntu-latest