Skip to content

[Tech Debt]Add cross-language resource consistency checking tool#579

Open
da-daken wants to merge 9 commits intoapache:mainfrom
da-daken:resource_ci_check
Open

[Tech Debt]Add cross-language resource consistency checking tool#579
da-daken wants to merge 9 commits intoapache:mainfrom
da-daken:resource_ci_check

Conversation

@da-daken
Copy link
Copy Markdown

@da-daken da-daken commented Mar 19, 2026

Linked issue: #xxx

Purpose of change

to fix that 'It would be nice check in CI that the referenced class actually exist, and names in Java and Python are consistent.'

Tests

API

no API

  • doc-needed
  • doc-not-needed
  • doc-included

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue. and removed doc-not-needed Your PR changes do not impact docs labels Mar 19, 2026
@da-daken
Copy link
Copy Markdown
Author

da-daken commented Mar 22, 2026

hi @xintongsong , This push did not trigger CI. I noticed that the error message in CI indicates that astral-sh/setup-uv@v4 is not allowed, but I didn't add it. How should I resolve this issue? and hope you can review when you have time!

@xintongsong
Copy link
Copy Markdown
Contributor

@da-daken Sorry for the late response. It took us a bit time to fix the CI issue. Now the CI should be properly triggered.

@da-daken
Copy link
Copy Markdown
Author

@xintongsong Thank you for resolving the CI issue. Now the CI has all passed. You can review it when you have time. The plan is for both the Java side and the Python side to check whether their own classes exist, and then a consistency script will determine if both sides are consistent. This way, we can verify that the classes on both sides can be correctly loaded.

Copy link
Copy Markdown
Collaborator

@wenjin272 wenjin272 left a comment

Choose a reason for hiding this comment

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

Hi, @da-daken, thanks for your work. I think the three added tests—java ut, python ut, and java vs. python e2e—can ensure consistency in resource names. I left some minor comments.

echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check code style
run: ./tools/lint.sh -c
- name: Check ResourceName consistency (Java vs Python)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think that placing consistency checks for resource names within code style checks is not entirely appropriate, because code style typically refers to the checking of coding conventions and rules within a single language. I think it is more appropriate to include it in the cross-language test.

test = [
"pytest==8.4.0",
"apache-flink>=1.20",
"cloudpickle",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If the consistency check for resource names is moved to the cross-language test, these additional dependencies are unnecessary because we manually install apache-flink in tools/e2e.sh.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, you're right! thank you for your review! I will commit soon

tools/e2e.sh
- name: Check ResourceName consistency (Java vs Python)
working-directory: python
run: uv run --no-sync python ../tools/check_resource_consistency.py No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can add this test to e2e.sh instead of creating a separate job stage.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, it looks cleaner this way, I will move it to e2e.sh

@wenjin272
Copy link
Copy Markdown
Collaborator

LGTM. Please take a look at your convenience @xintongsong .

Copy link
Copy Markdown
Contributor

@xintongsong xintongsong left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, @da-daken and @wenjin272. I left 2 more comments. PTAL.

("OPENAI_COMPLETIONS_CONNECTION", "OPENAI_CONNECTION"),
("OPENAI_COMPLETIONS_SETUP", "OPENAI_SETUP"),
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of maintaining _NAME_ALIASES to work around naming inconsistencies between Java and Python, I think we should fix the root cause — unify the constant names on both sides.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thanks for you review , I have fixed consistency between Python resourceName and Java resourceName!

from pathlib import Path


def parse_java_resource_name(java_path: Path) -> dict:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shall we place this script in e2e-test/test-scripts/? tools/ is meant for scripts directly executed by developers / maintainers. Those indirectly invoked by e2e.sh should be placed in e2e-test/test-scripts/.

Copy link
Copy Markdown
Collaborator

@wenjin272 wenjin272 left a comment

Choose a reason for hiding this comment

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

Hi, @da-daken, only one comment.

OPENAI_CONNECTION = "flink_agents.integrations.chat_models.openai.openai_chat_model.OpenAIChatModelConnection"
OPENAI_SETUP = "flink_agents.integrations.chat_models.openai.openai_chat_model.OpenAIChatModelSetup"
OPENAI_COMPLETIONS_CONNECTION = "flink_agents.integrations.chat_models.openai.openai_chat_model.OpenAIChatModelConnection"
OPENAI_COMPLETIONS_SETUP = "flink_agents.integrations.chat_models.openai.openai_chat_model.OpenAIChatModelSetup"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need to synchronously update all instances in the documentation where these constants are used.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@wenjin272 are you willing to push again? It looks like the CI failure is an environment issue.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi, @da-daken, the "documents" mentioned here refer not only to docstrings in Python files but also to Markdown files in the docs directory. You can perform a global search for the usage of these two constants.

Copy link
Copy Markdown
Author

@da-daken da-daken Apr 9, 2026

Choose a reason for hiding this comment

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

hi @wenjin272 , I updated all the references in the latest commit.

Copy link
Copy Markdown
Collaborator

@wenjin272 wenjin272 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@wenjin272 wenjin272 left a comment

Choose a reason for hiding this comment

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

LGTM

@da-daken da-daken requested a review from xintongsong April 10, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants