Skip to content

Conversation

@RobertGlobant20
Copy link
Contributor

@RobertGlobant20 RobertGlobant20 commented Sep 18, 2025

Purpose

This new github workflow will check if a pull request merged has updated any file under the subfolders of doc/distrib/html/*/**, if that is the case then will create another PR that will be updating the files in the corresponding folder under src/, in this way the developer will only focus in updating the html files under doc/distrib/html/.

Declarations

Check these if you believe they are true

Release Notes

adding a new github workflow for adding the html documentation under src/ folder

Reviewers

@QilongTang @reddyashish @zeusongit @avidit

FYIs

This new github workflow will check if a pull request merged has updated any file under the subfolders of doc/distrib/html/*/**, if that is the case then will create another PR that will be updating the files in the corresponding folder under src/, in this way the developer will only focus in updating the html files under  doc/distrib/html/.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9484

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new GitHub Actions workflow to automatically mirror updated HTML documentation from doc/distrib/html into corresponding files under src/ by opening a follow-up PR after a documentation-related PR is merged into master.

  • Detects changed .html files in doc/distrib/html after a PR merge.
  • Maps those to existing files under src/ (by language) and overwrites them, then opens an automated PR with the updates.

filename = os.path.basename(f)

# Get the language of the current file
lang_match = [p for p in lang_dirs if p in f][0]
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Using substring containment (p in f) risks incorrect matches (e.g., language code 'en' matching an unrelated path segment). Parse the path segments and require an exact directory match after doc/distrib/html to avoid accidental misclassification. Use something like:

parts = f.split('/')
if len(parts) > 3:
candidate = parts[3]
if candidate in lang_dirs:
lang_match = candidate
else:
print(f"No exact language directory match for {f}")
continue
Suggested change
lang_match = [p for p in lang_dirs if p in f][0]
parts = f.split('/')
if len(parts) > 3:
candidate = parts[3]
if candidate in lang_dirs:
lang_match = candidate
else:
print(f"No exact language directory match for {f}")
continue
else:
print(f"Path {f} does not have enough segments to determine language directory")
continue

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +116
for f in file_map:
src_path = f[0]
dest_path = f[1]
# Copy the file to destination
shutil.copy2(src_path, dest_path)
print(f"Copied {src_path} -> {dest_path}")
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Deletions or renames in doc/distrib/html are not propagated; stale files under src/ will persist. Consider comparing the set of expected html files per language and removing (or flagging) files in src/ that no longer exist at source. Add logic to detect removed originals and either delete or open an issue/PR note.

Copilot uses AI. Check for mistakes.

# Create new branch
git checkout -b $BRANCH
git add .
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Using git add . may include unrelated files (e.g., transient changes, generated artifacts) leading to noisy automated PRs. Restrict the add to only the mapped destination files (tracked during copy) or to patterns (e.g., git add src/**/*.html) to minimize risk.

Suggested change
git add .
# Add only the destination files from FILE_MAP
DEST_FILES=$(echo "$FILE_MAP" | python3 -c "import sys, json; print(' '.join([f[1] for f in json.load(sys.stdin).items()]))" 2>/dev/null || echo "")
if [[ -n "$DEST_FILES" ]]; then
git add $DEST_FILES
fi

Copilot uses AI. Check for mistakes.
RobertGlobant20 and others added 3 commits September 19, 2025 12:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Code Review changes
@RobertGlobant20
Copy link
Contributor Author

All tests Passed in DYN-DevCI_Self_Service job
https://master-15.jenkins.autodesk.com/view/DYN/job/DYN-DevCI_Self_Service/1489/

@zeusongit zeusongit merged commit e08baba into DynamoDS:master Sep 22, 2025
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants