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

Bake task for filter collections #300

Merged
merged 2 commits into from
Nov 9, 2020
Merged

Bake task for filter collections #300

merged 2 commits into from
Nov 9, 2020

Conversation

dereuromark
Copy link
Member

@dereuromark dereuromark commented Nov 4, 2020

I whipped sth up
Resolves #296

I didn't check the visibility on the entity yet, if I should do that let me know
But this already works quite well for default cases IMO.

  • Model handling if not matching the collection name
  • Prefix handling

We could think about further improvements as follow up:

  • No argument => ask [y/n] to bake each existing model of that namespace into the same name of collection

@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #300 (3136c16) into master (8376995) will decrease coverage by 0.53%.
The diff coverage is 90.24%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #300      +/-   ##
============================================
- Coverage     93.92%   93.38%   -0.54%     
- Complexity      204      227      +23     
============================================
  Files            17       18       +1     
  Lines           510      590      +80     
============================================
+ Hits            479      551      +72     
- Misses           31       39       +8     
Impacted Files Coverage Δ Complexity Δ
src/Command/BakeFilterCollectionCommand.php 89.74% <89.74%> (ø) 23.00 <23.00> (?)
src/Model/Filter/Base.php 93.97% <100.00%> (+0.07%) 37.00 <0.00> (ø)
src/Processor.php 96.96% <100.00%> (+0.09%) 13.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8376995...3136c16. Read the comment docs.

@dereuromark
Copy link
Member Author

dereuromark commented Nov 4, 2020

This whole file system generation and comparison thing is a bit strange
For some reason it fails only for https://travis-ci.com/github/FriendsOfCake/search/jobs/428393497 still.
This is prefer lowest, must be related to that.

@ADmad
Copy link
Member

ADmad commented Nov 6, 2020

This is prefer lowest, must be related to that.

That's the problem with using prefer lowest, you don't get the bug fixes required :)

@dereuromark
Copy link
Member Author

Any takes on what needs to be bumped? Or should we completely rewrite file based generation testing?
Using memory files or sth?

@ADmad
Copy link
Member

ADmad commented Nov 6, 2020

My guess would be it's the twig view plugin for which a particular big bugfix is required.

@dereuromark
Copy link
Member Author

Otherwise all good? Or do you see any concerns so far?

@dereuromark
Copy link
Member Author

Tests are now fixed :)

*/
public function initialize(): void
{
$this->value('author_id');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for simplicity of the command, I decided not to do this.
Do you have an idea on how to easily achieve that?

For me, it seems enough as is, since it works both equally, and the lines don't increase.
So I am fine either way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's the same number of lines but avoid repeatation of $this would be nice.

You can check bake's temple for tables and see how it generates the chaining. It should be just a matter of tweaking a loop but if it's too much trouble we can keep as it is.

@ADmad
Copy link
Member

ADmad commented Nov 7, 2020

CS job is still failing, wonder why stickler hasn't fixed it.

@dereuromark
Copy link
Member Author

The CS fails seemed unrelated, but I fixed them now as well
After rebase I expect this to be green now.

As for the $this chaining. I think this would need a helper method and some additional internal logic.
If you don't mind I would like to hold off on that for now as a future follow up (maybe together with the improvements above).

@@ -5,6 +5,9 @@ linters:
extensions: 'php'
fixer: true

files:
ignore: ['tests/comparisons/*']
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markstory Any idea why this could be ignored in stickler still?
I copied this from https://github.com/cakephp/migrations/blob/master/.stickler.yml#L4-L5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you aiming to have these files not checked? That is what this config would do.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, FriendsOfCake is using the OAuth version of the integration so we won't see any logs here. If the GitHubApp integration was used we'd get better logs and annotations instead of comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done Stickler's GitHubApp integration now for FOC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stickler respects phpcs.xml right? So it would be better to add the ignores there @dereuromark.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ADmad it does.

@ADmad ADmad closed this Nov 9, 2020
@ADmad ADmad reopened this Nov 9, 2020
@ADmad ADmad closed this Nov 9, 2020
@ADmad ADmad reopened this Nov 9, 2020
@ADmad ADmad merged commit 3136c16 into master Nov 9, 2020
@dereuromark dereuromark deleted the bake-task branch November 9, 2020 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bake filter collections?
4 participants