Skip to content

Comments

Fix redefined RE init flags#1953

Merged
feluelle merged 1 commit intomainfrom
fix/dev-init-remote-exec
Oct 8, 2025
Merged

Fix redefined RE init flags#1953
feluelle merged 1 commit intomainfrom
fix/dev-init-remote-exec

Conversation

@feluelle
Copy link
Member

@feluelle feluelle commented Oct 8, 2025

Description

Describe the purpose of this pull request.

Under certain circumstances such as when the context cannot be retrieved and the platform hasn't been selected, we would define the new remote-execution-enabled flag twice. This change ensures that we only define it once.

🎟 Issue(s)

Fixes the IT for testing dev init:

FAILED dev_test.py::test_dev_init - AssertionError: assert 2 == 0
 +  where 2 = CompletedProcess(args=['/home/circleci/project/astro', 'dev', 'init'], returncode=2, stdout='', stderr='panic: init flag redefined: remote-execution-enabled\n\ngoroutine 1 [running]:\ngithub.com/spf13/pflag.(*FlagSet).AddFlag(0xc0003f6b00, 0xc0004c6e60)\n\t/home/circleci/.go_workspace/pkg/mod/github.com/spf13/[email protected]/flag.go:848 +0x5fc\ngithub.com/spf13/pflag.(*FlagSet).VarPF(0xc0003f6b00, {0x301ddb0, 0x477b8ab}, {0x2be943b, 0x18}, {0x0, 0x0}, {0x2c9ca39, 0x9f})\n\t/home/circleci/.go_workspace/pkg/mod/github.com/spf13/[email protected]/flag.go:831 +0x105\ngithub.com/spf13/pflag.(*FlagSet).BoolVarP(0xc0003f6b00?, 0x2be9453?, {0x2be943b?, 0x0?}, {0x0?, 0x0?}, 0x0?, {0x2c9ca39?, 0x0?})\n\t/home/circleci/.go_workspace/pkg/mod/github.com/spf13/[email protected]/bool.go:55 +0x3e\ngithub.com/astronomer/astro-cli/cmd.newAirflowInitCmd()\n\t/home/circleci/project/cmd/airflow.go:206 +0x5c5\ngithub.com/astronomer/astro-cli/cmd.newDevRootCmd({0x305ffd0, 0xc0002fc9c0}, {0x306ee18, 0xc0002fc9a0})\n\t/home/circleci/project/cmd/airflow.go:152 +0x192\ngithub.com/astronomer/astro-cli/cmd.NewRootCmd()\n\t/home/circleci/project/cmd/root.go:78 +0x636\nmain.main()\n\t/home/circleci/project/main.go:21 +0x2a\n').returncode

see also https://app.circleci.com/pipelines/github/astronomer/astro-cli/6640/workflows/77fbf0af-02c6-43e3-aa3d-057a4e3aef88/jobs/14604

🧪 Functional Testing

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

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 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

@coveralls-official
Copy link

coveralls-official bot commented Oct 8, 2025

Pull Request Test Coverage Report for Build 6534765e-9ebb-4629-a14b-471080427459

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 38.422%

Files with Coverage Reduction New Missed Lines %
cmd/airflow.go 1 91.34%
Totals Coverage Status
Change from base Build bb730335-efb2-4640-8c0b-898956d4b5ff: 0.002%
Covered Lines: 24029
Relevant Lines: 62539

💛 - Coveralls

@feluelle feluelle force-pushed the fix/dev-init-remote-exec branch from 2bfd062 to f3f6caa Compare October 8, 2025 07:44
@feluelle feluelle force-pushed the fix/dev-init-remote-exec branch from f3f6caa to 34b3e98 Compare October 8, 2025 07:59
@feluelle feluelle changed the title Fix redefined RE init flags in case of context error Fix redefined RE init flags Oct 8, 2025
@feluelle feluelle requested a review from neel-astro October 8, 2025 08:00
@feluelle
Copy link
Member Author

feluelle commented Oct 8, 2025

Merging as the previous failed IT now passes.

@feluelle feluelle merged commit 64d90de into main Oct 8, 2025
6 of 7 checks passed
@feluelle feluelle deleted the fix/dev-init-remote-exec branch October 8, 2025 08:10
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