Skip to content

FLINK-5725: Add extra Flink details to paasta status #4063

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8ec0c76
FLINK-5725: Add extra Flink details to paasta status
nleigh May 13, 2025
fab0eb5
FLINK-5725: Add extra Flink details to paasta status: git repo's
nleigh May 13, 2025
28381c5
FLINK-5725: Add extra Flink details to paasta status: log commands
nleigh May 13, 2025
1fb40c6
FLINK-5725: Add extra Flink details to paasta status: flink monitoring
nleigh May 13, 2025
56cdcc5
FLINK-5725: Add SUPPERREGION_TO_ECOSYSTEM_MAPPINGS
nleigh May 14, 2025
02c4363
FLINK-5725: Update souregraph to github link
nleigh May 14, 2025
7806ecf
FLINK-5725: Add owner information to flink paasta status verbose
nleigh May 14, 2025
ba32de6
FLINK-5725: Refactors
nleigh May 14, 2025
2a65cc6
FLINK-5725: Add flink pool information to flink paasta status verbose
nleigh May 14, 2025
fa93667
FLINK-5725: Add runbook information to flink paasta status verbose
nleigh May 14, 2025
16a304f
FLINK-5725: Fix missing return statement error
nleigh May 15, 2025
06319d8
FLINK-5725: Add Flink cost link to paasta status -v
nleigh May 16, 2025
7357296
Merge branch 'master' into u/nathanleigh/FLINK-5725/AddMoreDetailsToF…
nleigh May 23, 2025
024fdcc
FLINK-5725: Update yelp region -> ecosystem mapping logic
nleigh May 30, 2025
1718cb1
Merge branch 'master' into u/nathanleigh/FLINK-5725/AddMoreDetailsToF…
nleigh May 30, 2025
ce4de9f
FLINK-5725: Downgrade environment-tools
nleigh May 30, 2025
141a8ae
Merge remote-tracking branch 'origin/u/nathanleigh/FLINK-5725/AddMore…
nleigh May 30, 2025
d78be12
FLINK-5725: Mock convert_location_type return
nleigh May 30, 2025
2720594
FLINK-5725: Use 'fake-cluster' name in tests
nleigh Jun 4, 2025
d42bc6e
Update requirements-minimal.txt
nleigh Jun 4, 2025
c48c05b
FLINK-5725: Use existing helper functions
nleigh Jun 5, 2025
379592a
FLINK-5725: Use existing helper functions 2
nleigh Jun 5, 2025
8f16b33
Update paasta_tools/cli/cmds/status.py
nleigh Jun 5, 2025
4cf48ba
Merge branch 'master' into u/nathanleigh/FLINK-5725/AddMoreDetailsToF…
nleigh Jun 5, 2025
1e89fd5
Update paasta_tools/cli/cmds/status.py
nleigh Jun 5, 2025
68b42b6
FLINK-5725: Refactors and remove try/exception
nleigh Jun 5, 2025
da0226f
FLINK-5725: Move ecosytem function to utils
nleigh Jun 5, 2025
d7ac273
FLINK-5725: Fix tox issues
nleigh Jun 5, 2025
994e4d6
Update paasta_tools/flink_tools.py
nleigh Jun 5, 2025
33b03fa
Update paasta_tools/utils.py
nleigh Jun 5, 2025
022b9c4
FLINK-5725: Rename fake-cluster to fake_cluster
nleigh Jun 5, 2025
ffab533
Merge remote-tracking branch 'origin/u/nathanleigh/FLINK-5725/AddMore…
nleigh Jun 5, 2025
42fc583
Update paasta_tools/utils.py
nleigh Jun 6, 2025
571a4cd
Update paasta_tools/utils.py
nleigh Jun 6, 2025
377584d
Update paasta_tools/utils.py
nleigh Jun 6, 2025
22d2921
Update paasta_tools/cli/cmds/status.py
nleigh Jun 6, 2025
dbc5e66
Update paasta_tools/utils.py
nleigh Jun 6, 2025
e0388bb
FLINK-5725: Update test mock
nleigh Jun 6, 2025
4a93fdf
FLINK-5725: Fix tox issues
nleigh Jun 6, 2025
7138c66
Merge branch 'master' into u/nathanleigh/FLINK-5725/AddMoreDetailsToF…
nleigh Jun 10, 2025
399c0ad
Update paasta_tools/cli/cmds/status.py
nleigh Jun 10, 2025
b71546c
Update tests/test_utils.py
nleigh Jun 10, 2025
d5e6765
Update tests/test_utils.py
nleigh Jun 10, 2025
5bf589d
Update paasta_tools/cli/cmds/status.py
nleigh Jun 10, 2025
d946ba3
FLINK-5725: Fix indentation + refactor
nleigh Jun 10, 2025
c1792da
FLINK-5725: Remove if statement check
nleigh Jun 10, 2025
4ba30b3
FLINK-5725: Fix tests by populating flink_instance_config
nleigh Jun 10, 2025
55b4371
Update tests/test_utils.py
nleigh Jun 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions paasta_tools/cli/cmds/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ def append_pod_status(pod_status, output: List[str]):
def _print_flink_status_from_job_manager(
service: str,
instance: str,
cluster: str,
output: List[str],
flink: Mapping[str, Any],
client: PaastaOApiClient,
Expand Down Expand Up @@ -809,6 +810,17 @@ def _print_flink_status_from_job_manager(
dashboard_url = metadata["annotations"].get("flink.yelp.com/dashboard_url")
output.append(f" URL: {dashboard_url}/")

# Print Flink config link resources
if verbose:
output.append(
f" Yelpsoa configs: https://sourcegraph.yelpcorp.com/sysgit/yelpsoa-configs/-/tree/{service}"
)
cluster_without_pnw_dash = cluster.replace("pnw-", "")
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using .replace("pnw-", "") may remove multiple occurrences of the substring instead of only the prefix. Consider using a conditional check or a method that only removes the prefix if present.

Suggested change
cluster_without_pnw_dash = cluster.replace("pnw-", "")
cluster_without_pnw_dash = cluster.removeprefix("pnw-")

Copilot uses AI. Check for mistakes.

output.append(
f" Srv configs: https://sourcegraph.yelpcorp.com/sysgit/srv-configs/-/tree/ecosystem/"
f"{cluster_without_pnw_dash}/{service}"
)

color = PaastaColors.green if status["state"] == "running" else PaastaColors.yellow
output.append(f" State: {color(status['state'].title())}")

Expand Down Expand Up @@ -988,7 +1000,7 @@ def print_flink_status(
return 1

return _print_flink_status_from_job_manager(
service, instance, output, flink, client, verbose
service, instance, cluster, output, flink, client, verbose
)


Expand All @@ -1015,7 +1027,7 @@ def print_flinkeks_status(
return 1

return _print_flink_status_from_job_manager(
service, instance, output, flink, client, verbose
service, instance, cluster, output, flink, client, verbose
)


Expand Down
8 changes: 7 additions & 1 deletion tests/cli/test_cmds_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2712,6 +2712,8 @@ def test_output_stopping_jobmanager(
status = mock_flink_status["status"]
expected_output = [
f" Config SHA: 00000",
f" Yelpsoa configs: https://sourcegraph.yelpcorp.com/sysgit/yelpsoa-configs/-/tree/fake_service",
f" Srv configs: https://sourcegraph.yelpcorp.com/sysgit/srv-configs/-/tree/ecosystem/fake_cluster/fake_service",
f" State: {PaastaColors.yellow(status['state'].title())}",
f" Pods: 3 running, 0 evicted, 0 other",
]
Expand Down Expand Up @@ -2755,6 +2757,8 @@ def test_output_stopping_taskmanagers(
status = mock_flink_status["status"]
expected_output = [
f" Config SHA: 00000",
f" Yelpsoa configs: https://sourcegraph.yelpcorp.com/sysgit/yelpsoa-configs/-/tree/fake_service",
f" Srv configs: https://sourcegraph.yelpcorp.com/sysgit/srv-configs/-/tree/ecosystem/fake_cluster/fake_service",
f" State: {PaastaColors.yellow(status['state'].title())}",
f" Pods: 1 running, 0 evicted, 0 other",
]
Expand Down Expand Up @@ -2784,7 +2788,7 @@ def test_output_1_verbose(
mock_naturaltime.return_value = "one day ago"
output = []
print_flink_status(
cluster="fake_cluster",
cluster="pnw-fake_cluster",
service="fake_service",
instance="fake_instance",
output=output,
Expand All @@ -2798,6 +2802,8 @@ def test_output_1_verbose(
datetime.datetime.fromtimestamp(int(job_details_obj.start_time) // 1000)
)
expected_output = _get_base_status_verbose_1(metadata) + [
f" Yelpsoa configs: https://sourcegraph.yelpcorp.com/sysgit/yelpsoa-configs/-/tree/fake_service",
f" Srv configs: https://sourcegraph.yelpcorp.com/sysgit/srv-configs/-/tree/ecosystem/fake_cluster/fake_service",
f" State: {PaastaColors.green(status['state'].title())}",
f" Pods: 3 running, 0 evicted, 0 other",
f" Jobs: 1 running, 0 finished, 0 failed, 0 cancelled",
Expand Down