Fix: Strip newline characters from dag_integrity_exceptions.txt entries by mohasoori · Pull Request #1802 · astronomer/astro-cli

Description

By stripping the output, we ensure that DAG names are correctly matched as defined in dag_integrity_exceptions.txt.

Example output before fix:

Exceptions: ['# Add dag files to exempt from parse test below. ex: dags/<test-file>\n', 'dags/dag_example1\n', 'dags/dag_example2.py']

🎟 Issue(s)

The readlines module does not strip newline characters (\n) from the output, causing entries in dag_integrity_exceptions.txt to include them. This leads to incorrect comparisons and breaks the logic.

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

Add screenshots to illustrate the validity of these changes.
Before change:
image

After change:
image

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation