Skip to content

Conversation

Copy link

Copilot AI commented Sep 16, 2025

Fixes CI workflows to only enforce branch, changelog, and milestone restrictions in the main astropy/astropy repository, allowing forks to open PRs against any branch without CI restrictions.

Problem

The current CI checks in .github/workflows/ci_workflows.yml, .github/workflows/check_changelog.yml, and .github/workflows/check_milestone.yml apply to all repositories, including forks. This means that users working in their own forks cannot open PRs against development branches or feature branches - they are forced to only target the main branch and must include changelog entries and milestones, which limits development workflow flexibility in forks.

Solution

Modified the base branch check, towncrier changelog check, and milestone check to only apply when the repository is the main astropy/astropy repository using the simple if: github.repository == 'astropy/astropy' condition.

For the main repository (astropy/astropy):

  • PRs are still restricted to the main branch (unless using skip label or meeseeks auto-backport)
  • Changelog entries are still required via towncrier
  • Milestones are still required
  • All existing protection remains in place

For fork repositories (e.g., user/astropy):

  • PRs can be opened against any branch without restriction
  • Changelog validation is skipped
  • Milestone requirements are skipped
  • Enables flexible development workflows in forks

Changes

Base Branch Check (ci_workflows.yml):

  • Added github.repository == 'astropy/astropy' condition to the existing check
  • Preserved all existing functionality and edge cases (skip labels, meeseeks, etc.)

Towncrier Changelog Check (check_changelog.yml):

  • Added if: github.repository == 'astropy/astropy' condition to the towncrier action
  • Simple and clean single-condition implementation

Milestone Check (check_milestone.yml):

  • Uses the existing simple if: github.repository == 'astropy/astropy' condition
  • Clean and straightforward implementation

The changes are minimal and maintain backward compatibility while enabling the desired fork flexibility for branch targeting, changelog requirements, and milestone requirements. All implementations use the simple and clean if: github.repository == 'astropy/astropy' pattern.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

timj and others added 30 commits July 11, 2025 12:46
Cannot use the version setter because we allow v1.0 files to
be read from XML even though we don't allow someone to create
one with the APIs directly.
This ensures that error messages can report the actual
version without having to work it out from the or_later
values.
Without this change the COOSYS was coming before INFO and this
was failing linting because the schema requires INFO to come
first.

ERROR (l.8, c.59): cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.ivoa.net/xml/VOTable/v1.3":INFO}'.
One of '{"http://www.ivoa.net/xml/VOTable/v1.3":COOSYS,
"http://www.ivoa.net/xml/VOTable/v1.3":TIMESYS,
"http://www.ivoa.net/xml/VOTable/v1.3":GROUP,
"http://www.ivoa.net/xml/VOTable/v1.3":PARAM,
"http://www.ivoa.net/xml/VOTable/v1.3":LINK,
"http://www.ivoa.net/xml/VOTable/v1.3":TABLE,
"http://www.ivoa.net/xml/VOTable/v1.3":RESOURCE,
WC[##other:"http://www.ivoa.net/xml/VOTable/v1.3"]}' is expected.
Fix bug in Wcs.wcs.print_contents() related to stdout buffer not bein…
…th more than 2 dimensions but with _naxis not set would fail, and that slicing a WCS with an ellipsis would not return a WCS object but a SlicedFITSWCS instead
@github-actions
Copy link

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions
Copy link

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@nstarman
Copy link
Owner

@copilot also update the towncrier CI check to only apply to PRs on the astropy repo.

Copilot AI changed the title [WIP] Make a PR that updates the CI job Mandatory checks before CI so that the basebranch check which restricts PRs to only be against main only applies to the main Astropy repo, so that in forks you can open PRs against any branch. Allow PRs against any branch in forks while restricting to main in astropy/astropy Sep 16, 2025
Copilot AI requested a review from nstarman September 16, 2025 14:20
Copy link
Author

Copilot AI commented Sep 16, 2025

@copilot also update the towncrier CI check to only apply to PRs on the astropy repo.

Updated the towncrier changelog check in .github/workflows/check_changelog.yml to only apply to PRs in the main astropy/astropy repository. Fork repositories will now skip both the base branch check and changelog validation. Changes committed in f76aed7.

Copilot AI changed the title Allow PRs against any branch in forks while restricting to main in astropy/astropy Allow PRs against any branch in forks while restricting CI checks to main in astropy/astropy Sep 16, 2025
@nstarman
Copy link
Owner

@copilot also update the milestone check to only apply to PRs on the astropy repo, not forks.

@nstarman nstarman removed this from the v7.2.0 milestone Sep 16, 2025
@nstarman
Copy link
Owner

@copilot does if: github.repository == 'astropy/astropy' not work? If it does, then use that instead of more complex solutions.

Copy link
Author

Copilot AI commented Sep 16, 2025

@copilot does if: github.repository == 'astropy/astropy' not work? If it does, then use that instead of more complex solutions.

You're absolutely right! The simple if: github.repository == 'astropy/astropy' condition works perfectly and is much cleaner. I've simplified all three workflows to use this approach instead of the complex GitHub script solutions. Changes committed in 0ad1a91.

@nstarman nstarman closed this Sep 16, 2025
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.