sceptre icon indicating copy to clipboard operation
sceptre copied to clipboard

[Resolves #1268] Modify ConfigFileNotFound Error to Conditionally Include Valid Stack Paths

Open X-Guardian opened this issue 3 years ago • 4 comments

Modifies the Sceptre Plan ConfigFileNotFound error to only include the list of valid stack paths from the command path specified and only there are less than 10 stacks.

Example

sceptre launch dev/service1/foo.yaml

New Error Message (when there are less than 10 stacks under the specified parent path)

"No stacks detected from the given path 'dev/service1/foo.yaml'. Valid stack paths under 'dev/service1' are: ['dev/service1/foo1.yaml', 'dev/service1/foo2.yaml', 'dev/service1/subservice1/foo3.yaml']"

New Error Message (when there are 10 stacks or more under the specified parent path)

"No stacks detected from the given path 'dev/service1/foo.yaml'."
  • Resolves #1268

PR Checklist

  • [ ] Wrote a good commit message & description [see guide below].
  • [ ] Commit message starts with [Resolve #issue-number].
  • [ ] Added/Updated unit tests.
  • [ ] Added/Updated integration tests (if applicable).
  • [ ] All unit tests (make test) are passing.
  • [ ] Used the same coding conventions as the rest of the project.
  • [ ] The new code passes pre-commit validations (pre-commit run --all-files).
  • [ ] The PR relates to only one subject with a clear title. and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • [ ] Before merge squash related commits.

Other Information

Guide to writing a good commit

X-Guardian avatar Nov 28 '22 14:11 X-Guardian

@X-Guardian, what are the status on the tests for this PR?

jfalkenstein avatar Jan 03 '23 19:01 jfalkenstein

@X-Guardian Do you have any plans to finish this PR?

alex-harvey-z3q avatar Jun 14 '24 09:06 alex-harvey-z3q

From what I remember it works, but I don't use Sceptre any more, so won't be writing any tests, which is what I think was blocking this getting merged.

X-Guardian avatar Jun 14 '24 10:06 X-Guardian

@zaro0508 I have had a look at this stale PR and I agree with @X-Guardian and I think the PR should be merged as-is. The new private method is simply tweaking the error message seen and I do not think that such a trivial change justifies us adding more unit test code. Nor is it obvious to me how you would test this anyway.

Could we merge? I've added it into my integration branch and I'm certainly happy with it.

alex-harvey-z3q avatar Jun 16 '24 07:06 alex-harvey-z3q