Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deptrac.yaml file examples - and init command broken #977

Closed
gnat42 opened this issue Sep 9, 2022 · 8 comments · Fixed by #987
Closed

deptrac.yaml file examples - and init command broken #977

gnat42 opened this issue Sep 9, 2022 · 8 comments · Fixed by #987

Comments

@gnat42
Copy link

gnat42 commented Sep 9, 2022

Hello,

First off thank you for maintaining/developing this library. I had version 0.10.2 (via deptrac-shim) installed for quite awhile and upgraded recently to 0.24.0. When I did the upgrade I couldn't get anything to work from the old file. I looked at the examples I could find and most were something along the lines of

deptrac:
   paths: ...

When I modified mine, it complained it couldn't find anything to handle deptrac (something along those lines). Took a bit of digging around, switching versions using this repository directly for me to get it figured out. I tried the init command but that got me an error about not being able to create the file. Once I worked around that issue I could see what the default file was which is as follows:

parameters:
   paths: ...

Once I made that change my original config file functioned as expected.

I can submit some PRs but there are quite a few examples I wasn't entirely sure how mine is wrong. So, if the examples are infact no longer accurate, I can submit a PR but thought I would ask first.

Also the init command seemed broken unless the file already exists.
For example in Supportive/File/Dumper.php it creates a new SplFileInfo.php using the file path. And then here you check if its writeable but the file doesn't exist so it isn't. Again if a PR would help I can submit one to test if the file already exists before the writeable test etc.

@dbrumann
Copy link
Collaborator

dbrumann commented Sep 9, 2022

Yes, that could be very well be the case. We should definitely go over the docs and check again if the examples are up to date. If you already know of any case where the examples are wrong, feel free to update them.

As a background why we have this: I wanted to remove away from semantic configuration, so deptrac: in favor of a more generic one with parameters:. It turned out, that this breaks using multiple files, which is why the old way is now back.

If you already have a fix ready for the init command, feel free to submit. Otherwise I will have a look at it. Luckily, this is one of the easier commands, so hopefully a fix is straightforward.

@gnat42
Copy link
Author

gnat42 commented Sep 9, 2022

I've filed two separate PRs #981 and #982

@gnat42 gnat42 closed this as completed Sep 9, 2022
@dbrumann
Copy link
Collaborator

Sorry, I have to reopen this after viewing your doc-PR #981. Are you sure, you are on the most recent version of Deptrac?

You switched everything back to parameters:, but that should not be true for 0.24.0

We have a deptrac.yaml file we test against, which uses the deptrac: key and everything works.

@dbrumann dbrumann reopened this Sep 10, 2022
@dbrumann
Copy link
Collaborator

@gnat42
Copy link
Author

gnat42 commented Sep 10, 2022

Well, I'm as confident as I can be.

// composer.json
    "qossmic/deptrac-shim": "^0.24.0",

and

[gnat@msi]$ ./vendor/bin/deptrac --version
deptrac 0.24.0

@patrickkusebauch
Copy link
Collaborator

What I am sure about is that in dev-main branch everything uses deptrac. What I am not sure about is when we made the change. I think there might be a discrepancy between the last released version and when the docs have been republished.

@dbrumann
Copy link
Collaborator

I am still lost as to how this can happen. Can you show us how you run the command and can you double check that you are using the new filename (deptrac.yaml instead of depfile.yml)? I don't think the old way for loading the config file still works and using a wrong filename should not affect deptrac:/parameters:, but that is my only guess where things could go wrong

dbrumann pushed a commit to dbrumann/deptrac that referenced this issue Sep 22, 2022
dbrumann pushed a commit to dbrumann/deptrac that referenced this issue Sep 22, 2022
dbrumann pushed a commit to dbrumann/deptrac that referenced this issue Sep 22, 2022
dbrumann pushed a commit to dbrumann/deptrac that referenced this issue Sep 22, 2022
dbrumann pushed a commit to dbrumann/deptrac that referenced this issue Sep 22, 2022
@gnat42
Copy link
Author

gnat42 commented Sep 27, 2022

I don't know what to tell you. At this point in time, it works regardless of whether its deptrac: or parameters: ??

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 a pull request may close this issue.

3 participants