Skip to content
Open
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions charon/pkgs/radas_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,13 @@ async def generate_single_sign_file(
if not file_path or not signature:
logger.error("Invalid JSON entry")
return
# remove the root path maven-repository
filename = file_path.split("/", 1)[1]

parts = file_path.split("/", 1)
if len(parts) < 2:
logger.warning("Invalid entry: %s, skip signature file generation.", file_path)
return
# remove the root path maven-repository, valid file_path: maven-repository/...
filename = parts[1]
Copy link
Member

Choose a reason for hiding this comment

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

I think we should refine this logic. We can not predict that the radas signing path is starting with a $root(default is "maven-repository"), instead we should do some checking as below:

  • use $root from the "handle_maven_upload" in maven.py instead of the fixed "maven-repository" here
  • we should also check if the path is starting with this $root, and then decide how to do this path handling.

Copy link
Member Author

@yma955 yma955 Feb 27, 2026

Choose a reason for hiding this comment

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

@ligangty here is just a statement, I didn't predict radas result with fixed prefix "maven-repository" in code, any other root name would also be ok, and in following I use top_level to adapt the root cases.

To extend, we may just think about the result case of file path which not starts with(or contains) root, maybe we could join the top_level with the file path directly without any root name removal, WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

That sounds reasonable. If the $root does not exist in the result path, we should directly handle it. But if it exists, it should be as the prefix and we should remove it.

artifact_path = os.path.join(top_level, filename)
asc_filename = f"{filename}.asc"
signature_path = os.path.join(top_level, asc_filename)
Expand Down
Loading