Skip to content

feat: add idea validation script and GitHub Actions workflow#33

Merged
sinduri-g merged 4 commits into
mainfrom
feat/validate-ideas
Apr 3, 2026
Merged

feat: add idea validation script and GitHub Actions workflow#33
sinduri-g merged 4 commits into
mainfrom
feat/validate-ideas

Conversation

@sinduri-g
Copy link
Copy Markdown
Contributor

What does this PR do?

  • validate-idea.sh: checks template structure, required sections, and unfilled placeholders
  • validate-idea.yml: triggers on PRs adding ideas/*.md, validates PR title and file format

Type of PR

  • 💡 Adventure Idea
  • 🗺️ New Adventure Level
  • 📖 Solution Walkthrough
  • 🐛 Bug fix / 📝 Documentation improvement / Other

📝 Other

  • Commits are focused and minimal
  • Documentation updated if needed

- validate-idea.sh: checks template structure, required sections, and unfilled placeholders
- validate-idea.yml: triggers on PRs adding ideas/*.md, validates PR title and file format

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
@sinduri-g sinduri-g requested a review from a team as a code owner April 2, 2026 09:54
Copy link
Copy Markdown
Contributor

@KatharinaSick KatharinaSick left a comment

Choose a reason for hiding this comment

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

A few minor comments. Thank you 😊

Comment thread .github/workflows/validate-idea.yml Outdated
steps:

# Check PR title before checkout — fast fail with no runner cost.
- name: Check PR title format
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.

I think we don't need to be that strict on the PR title to not annoy people :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. Removed the check.

Comment thread .github/workflows/validate-idea.yml Outdated

# fetch-depth: 0 is required so git diff can compare against the base branch.
- name: Checkout repository
uses: actions/checkout@v4
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.

v6 is already available: https://github.com/actions/checkout

I also ran into that trap while vibe coding - it's not always using the latest versions 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hehehe, fixed it now.

Comment thread .github/workflows/validate-idea.yml Outdated
- name: Make validation script executable
run: chmod +x scripts/validate-idea.sh

# Only validate files *added* by this PR (not modified/deleted).
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.

Why only added? I think if an idea is modified, it would be great to check it as well?
(could happen if the idea author has an idea for an additional level e.g.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good Point. Updated to both Added and Modified.

Comment thread scripts/validate-idea.sh
# Strict mode
# ---------------------------------------------------------------------------
# -e is intentionally NOT set — we want all checks to run and collect every
# failure before exiting, so the contributor sees everything at once.
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.

Nice!

Comment thread scripts/validate-idea.sh Outdated
# Check 1 — File guard
# ---------------------------------------------------------------------------
# The workflow path filter handles this in CI, but local runs have no filter.
[[ "$FILE" == "ideas/adventure-idea-template.md" ]] \
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.

why is it actually not ok to dot hat? It would be nice after adjusting the template (e.g. changing wording)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The template file had placeholders and it wouldn't have passed the check. But I agree with your point, so adjusted that the template file is checked but the placeholders check will be skipped.

Comment thread scripts/validate-idea.sh Outdated
# ---------------------------------------------------------------------------
ERRORS_BEFORE=${#ERRORS[@]}

grep -qE "^### (🟢|🟡|🔴)" "$FILE" \
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.

I would not check for specific emojis - if it's a single level adventure or if there are more than 3 levels the emojis might differ

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True. Removed emoji specific check.

Copy link
Copy Markdown
Contributor

@KatharinaSick KatharinaSick left a comment

Choose a reason for hiding this comment

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

I really like how you did this checker but when revisiting the new-adventure script, I feel like there are a couple of checks missing - e.g. level metadata: https://github.com/dynatrace-oss/open-ecosystem-challenges/blob/main/scripts/new-adventure.sh#L23-L26

The more I think about it, the more I think if a dry run version of the new-adventure script wouldn't be easier than a separate script. But I also don't want to make you redo all the work -> your choice if we stay with 2 scripts or combine them into one with a dry-run option to test parsing. I think the level. metadata check is the most important thing we're missing

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
- Add idea-parser.sh with parse_adventure_header(), parse_level_heading(),
  extract_overview_field(), extract_level_section(), extract_level_description()
- Add ADVENTURE_HEADER_PATTERN and LEVEL_HEADING_PATTERN constants
- Update validate-idea.sh: use shared lib for all extraction and validation,
  add adventure header format check, add per-level subsection content checks,
  validate Theme/Technologies have content (not just presence)
- Update new-adventure.sh: source shared lib, remove all inline parsing

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
@sinduri-g
Copy link
Copy Markdown
Contributor Author

The more I think about it, the more I think if a dry run version of the new-adventure script wouldn't be easier than a separate script. But I also don't want to make you redo all the work -> your choice if we stay with 2 scripts or combine them into one with a dry-run option to test parsing. I think the level. metadata check is the most important thing we're missing

Rethought this added a idea-parser file that is a shared lib for all extraction and validation to be used in both new-adventure and validate-idea files

Copy link
Copy Markdown
Contributor

@KatharinaSick KatharinaSick left a comment

Choose a reason for hiding this comment

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

Looks good - thank you! :)

@sinduri-g sinduri-g merged commit bcab724 into main Apr 3, 2026
3 checks passed
@sinduri-g sinduri-g deleted the feat/validate-ideas branch April 3, 2026 06:55
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.

2 participants