Skip to content
Open
Show file tree
Hide file tree
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
25 changes: 4 additions & 21 deletions .github/workflows/new-module-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,11 @@ jobs:

echo "Verifying test module requirements..."

# 1. Check if excluded from maven deploy command
if ! grep -q "$MODULE_NAME" buildspecs/release-to-maven.yml 2>/dev/null; then
echo "::error::Module $MODULE_NAME is not excluded from maven deploy command in buildspecs/release-to-maven.yml"
HAS_ERRORS=1
else
echo "✅ Module is excluded from maven deploy command"
fi

# 2. Check if excluded from maven deploy command
if ! grep -q "$MODULE_NAME" buildspecs/release-to-maven-central.yml 2>/dev/null; then
echo "::error::Module $MODULE_NAME is not excluded from maven deploy command in buildspecs/release-to-maven-central.yml"
HAS_ERRORS=1
else
echo "✅ Module is excluded from maven deploy command"
fi

# 3. Check if excluded from javadoc generation
if ! grep -q "$MODULE_NAME" buildspecs/release-javadoc.yml 2>/dev/null; then
echo "::error::Module $MODULE_NAME is not excluded from javadoc generation in buildspecs/release-javadoc.yml"
HAS_ERRORS=1
# 1. Check if excluded from Maven publishing
if grep -qx "$MODULE_NAME" buildspecs/resources/test-modules-publish-allowlist.txt 2>/dev/null; then
echo "Module is in test-modules-publish-allowlist.txt - will be published to Maven"
else
echo "Module is excluded from javadoc generation"
echo "Module is not in test-modules-publish-allowlist.txt - will be excluded from Maven publishing"
fi

# 4. Check if Brazil import is skipped
Expand Down
13 changes: 13 additions & 0 deletions buildspecs/resources/generate-modules-to-skip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
REPO_ROOT=$(cd "$SCRIPT_DIR/../.." && pwd)
ALLOWLIST="$SCRIPT_DIR/test-modules-publish-allowlist.txt"

if [[ "$1" == "--docs" ]]; then
echo "$(ls "$REPO_ROOT/test/" | tr '\n' ',' | sed 's/,$//'),v2-migration"
elif [[ "$1" == "--maven" ]]; then
ls "$REPO_ROOT/test/" | grep -vxFf "$ALLOWLIST" | tr '\n' ',' | sed 's/,$//'
else
echo "Usage: $0 --maven | --docs" >&2
exit 1
fi
5 changes: 5 additions & 0 deletions buildspecs/resources/test-modules-publish-allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bundle-logging-bridge-binding-test
http-client-tests
ruleset-testing-core
service-test-utils
test-utils
68 changes: 8 additions & 60 deletions scripts/setup-new-module
Original file line number Diff line number Diff line change
Expand Up @@ -274,67 +274,15 @@ def update_brazil_json(root_dir, module_name, is_test):
with open(brazil_json, 'w') as f:
f.write(modified_content)
def update_buildspecs(root_dir, module_name):
"""Update buildspec files for test modules."""
release_maven = os.path.join(root_dir, 'buildspecs/release-to-maven.yml')
release_javadoc = os.path.join(root_dir, 'buildspecs/release-javadoc.yml')

# Update release-to-maven.yml
if os.path.isfile(release_maven):
with open(release_maven, 'r') as f:
content = f.read()

# Look for MODULES_TO_SKIP variable
modules_pattern = r'MODULES_TO_SKIP="([^"]*)"'
match = re.search(modules_pattern, content)

if match:
current_modules = match.group(1)
new_modules = f"{current_modules},{module_name}" if current_modules else module_name

# Update the file
modified_content = re.sub(
modules_pattern,
f'MODULES_TO_SKIP="{new_modules}"',
content
)

with open(release_maven, 'w') as f:
f.write(modified_content)

print(f"Updated MODULES_TO_SKIP in {release_maven} to include {module_name}")
else:
print(f"MODULES_TO_SKIP variable not found in {release_maven}. Please manually update.")
else:
print(f"Warning: {release_maven} does not exist. Skipping.")

# Update release-javadoc.yml
if os.path.isfile(release_javadoc):
with open(release_javadoc, 'r') as f:
content = f.read()

# Look for MODULES_TO_SKIP variable
modules_pattern = r'MODULES_TO_SKIP="([^"]*)"'
match = re.search(modules_pattern, content)

if match:
current_modules = match.group(1)
new_modules = f"{current_modules},{module_name}" if current_modules else module_name

# Update the file
modified_content = re.sub(
modules_pattern,
f'MODULES_TO_SKIP="{new_modules}"',
content
)

with open(release_javadoc, 'w') as f:
f.write(modified_content)

print(f"Updated MODULES_TO_SKIP in {release_javadoc} to include {module_name}")
else:
print(f"MODULES_TO_SKIP variable not found in {release_javadoc}. Please manually update.")
"""Update module publish allowlist for test modules."""
answer = input(f"Should {module_name} be published to Maven Central? (y/N): ").strip().lower()
if answer == 'y':
path = os.path.join(root_dir, 'buildspecs/resources/test-modules-publish-allowlist.txt')
with open(path, 'a') as f:
f.write(f"{module_name}\n")
print(f"Added {module_name} to {path}")
else:
print(f"Warning: {release_javadoc} does not exist. Skipping.")
print(f"{module_name} will be excluded from Maven publishing")
def main():
"""Main function to set up a new module."""
args = parse_arguments()
Expand Down
Loading