Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DX] A new way to submit issue reports #11494

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

Closed
javiereguiluz opened this issue Jul 28, 2014 · 31 comments
Closed

[DX] A new way to submit issue reports #11494

javiereguiluz opened this issue Jul 28, 2014 · 31 comments
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony)

Comments

@javiereguiluz
Copy link
Member

The problem

Issues are accumulating on Symfony repository as a faster pace that they can be solved. The obvious solution to reverse this situation could be to add more people, but there could be another way to solve it.

If you follow @jakzal, you know well the following message that he constantly repeats to issue reporters:

Could you fork Symfony Standard Edition and reproduce your issue on a new branch? That would help us to fix it a lot.

Indeed forking Symfony SE and reproducing the issue on a new branch is the best solution to confirm the bug and look for a solution (I guess @webmozart would also agree with this solution for the Form/Validator issues). But this is not necessarily an easy task to do.

The solution

I can think of two similar alternatives to fix this problem, but I'm sure that the community can propose other solutions.

Alternative 1

Use an approach similar to .phpt tests to describe in a single file the enviroment conditions and the classes and files relevant to reproduce the issue. An example of this file could be:

--ISSUE--
#11456
--SYMFONY--
2.5.0
--INI--
precision=14
--FILE--
bundle: AcmeDemoBundle
path:   Controller/DefaultController.php
<?php
    ...
--FILE--
bundle: AcmeDemoBundle
path:   Form/UserType.php
<?php
    ...
--FILE--
bundle: AcmeDemoBundle
path:   Resources/views/Default/index.html.twig
{{ ... }}

Alternative 2

We could create a new command called generate:issue_report which interacts with the developer to generate a very precise issue report. This would be its behavior:

$ php app/console generate:issue_report

 Automatic Symfony Issue Report Generator
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 Please, introduce the GitHub issue number for which you are generating a report:
 > 11289

 Please, pick up the files that you want to include in the issue report:

 ====  ====================================================================
 #     Path
 ====  ====================================================================
 1     src/Bundle/AcmeDemo/Controller/DefaultController.php
 2     src/Bundle/AcmeDemo/Controller/UserController.php
 3     src/Bundle/AcmeDemo/Form/UserType.php
 4     src/Bundle/AcmeDemo/Resources/views/Default/index.html.twig
 ...   ...
 ====  ====================================================================

 Which file(s) would you like to include? (separate them with commas)
 1, 3, 4

 Your issue report is ready to be submitted
 ------------------------------------------

 The report will be submitted to a private and secure location accessible only by
 Symfony core developers. The report will include:

   * Your composer.lock file
     (to install the exact same dependencies as yours)
   * All your configuration options
     (except security related options: secret, database password, etc.)
   * The contents of the files that you picked
     * src/Bundle/AcmeDemo/Controller/DefaultController.php
     * src/Bundle/AcmeDemo/Form/UserType.php
     * src/Bundle/AcmeDemo/Resources/views/Default/index.html.twig

 Do you agree sending this issue report (Y/n)? Y

 Sending the issue report to a secure location...

 SUCCESS
   Your issue report was successfully submitted to a secure location. The report
   was linked from the GitHub issue 11289, but only Symfony Core developers can
   access to its contents. Once the issue is fixed, your report contents will be
   safely deleted.

And then, on the related GitHub issue it would appear a new comment by fabbot.io linking to this report:

  fabbot.io commented:

    A detailed report is available for this issue. If you are a Symfony Core
    developer [click here](...) to access to its contents.
@wouterj
Copy link
Member

wouterj commented Jul 28, 2014

Why should it only be accesible for core developers? The strength of an opwn source communtiy is that everyone can pick up things to work on. Restricting access to core devs only means that only they can work on those issues. I'm afraid that'll cause an even slower solving time.

@javiereguiluz
Copy link
Member Author

@wouterj let's talk about the details later. First we should decide if this a stupid idea or something that we could consider.

@thewholelifetolearn
Copy link

I find the idea of a issue reporter as a good one. It would simplify the process and make it easier for people to show their environment.
But the issue report should also take in account the PHP modules loaded/used. After all, the problem could also come because of a particular version of PHP or its plugins.

@javiereguiluz
Copy link
Member Author

@thewholelifetolearn you are right: the report could also include the PHP.ini settings. But this is a detail to be discussed afterwards only if the idea is considered valid.

@Taluu
Copy link
Contributor

Taluu commented Jul 28, 2014

The second alternative seems great. But as it was said by @wouterj, it shouldn't be accessible only to core devs.

@thewholelifetolearn
Copy link

I agree too: the report should be accessible to everyone. Open source means opened to the world.
Maybe, it would be possible to use the "Gist" function of Github to report!
I don't know if it is possible to attach a zip file to issues in Github but it would be a possibility too.

@webmozart
Copy link
Contributor

I think "Alternative 1" is not very useful. The point of .phpt files is that a PHP developer can download them and launch them. They either fail or don't. If we create pseudo-tests that are in fact just descriptions with code, that's no more useful than current bug reports.

"Alternative 2" may be viable. However, I'm not sure if it helps. Currently, the hard and time-consuming task for someone fixing a bug is to find out how to reproduce it. This task doesn't necessarily become easier if a user submits the files that he thinks might be relevant.

I think submitting a symfony-standard fork is our equivalent to PHP's .phpt files. We can launch them, they fail or they don't. I also think creating a symfony-standard fork is one of the easiest ways to create a (useful) bug report. All developers are familiar with it, and they can simply copy the configuration of their project over to the test project instead of analyzing precisely which configuration values affect the bug and which don't.

@wouterj
Copy link
Member

wouterj commented Jul 28, 2014

Some thoughts:

  • People picking files from their full project wouldn't help that much. There is a 95% change that it will be broken, because some class is missing. People should still create a new project (called "fork"), add the minimal code needed to get the error and then run the command.
  • With that said, I'm not sure if running a command makes it easier/quicker than simply zipping it and posting it in GitHub.
  • I would prefer to go with a common know file format, instead of reinventing our own format. For instance, we can use patch files.
  • Commands like this should not be put in a framework bundle imo, since it is not related to the "framework feature". Maybe we have to include a task runner in the SE being able to do this. Related: symfony/symfony-standard#675
  • @fabpot once started a blog post serie about packing the SE in one file. In the first post, he noted that this would solve exactly this problem. However, he never came further than post 2. Will that ever be finished?

@merk
Copy link
Contributor

merk commented Jul 28, 2014

I'd just like to pipe in with a little comment, that i think is the primary point that spawned these issues:

The problem is not contributing PRs or issues. The problem is the lack of response (in many cases, months or years) from anyone at all.

It is close to impossible for contributors to help out triaging issues as an outsider - how do we enable non team members help diagnose/tag/close/triage/fix issues? Not everyone who wants to help has the skill or ability to code.

@cjunge-work
Copy link

I really like the idea of option 2. But as mentioned above, sometimes it's not Symfony itself that is causing the issue, it could be environmental.

I wonder if it'd be possible to use something like TravisCI to run tests against someone's fork/branch, so the testing environment is standard & known. It'd speed things up for narrowing down the issue.

Maybe a suggestion is to start using Gherkin to define tests, so they can be easily automated in some way?

@wouterj
Copy link
Member

wouterj commented Jul 28, 2014

Maybe a suggestion is to start using Gherkin to define tests, so they can be easily automated in some way?

👎 It would mean everyone needs to learn a complete new language and needs to know the available steps for Symfony.

I don't think these should be seen as tests. It should just be seen as packaging the local project of the reporter so we can look behind his shoulder, but without making secret information (including secret code) available on the web.

@trq
Copy link

trq commented Jul 29, 2014

I'm in agreeance with @merk here. As a reasonably new Symfony user it is hard to know how to contribute. I have many years experience with PHP and am sure I could be useful somewhere, but its hard to know where to start.

@webmozart
Copy link
Contributor

Maybe we're approaching the problem from the wrong direction. Maybe the solution is not to find a new way to submit issues, but to improve the documentation and tooling for setting up a Symfony development environment, reproducing bugs, actually developing Symfony etc.

@javiereguiluz
Copy link
Member Author

@webmozart this discussion tries to improve that.

@trq
Copy link

trq commented Jul 29, 2014

@webmozart I think it's actually a bit of both, but yeah, I would definitely welcome that discussion.

/me goes to look at #11465

@lmammino
Copy link

lmammino commented Aug 3, 2014

As @cjunge-work suggested, I was also wondering about travis or maybe a dedicated JoliCi instance managed by the symfony team (or stil some other simple testing environment managed with docker) to have a way to build environments easily and a share runnable test cases...

Anyway, at a first read, both of the proposed alternatives seems very legit to me. I believe we can also combine them and have the second alternative to produce a set of "standardized" declarations such as proposed in the alternative 1.

@liuggio
Copy link
Contributor

liuggio commented Aug 3, 2014

I agree with @webmozart, about the prospective,
do you think that creating a sort of mentoring group,
more knowledgeable person that pushes people to create a sf2 bugged branch,
and ping core developers, would help?

There's huge gap between core dev and sf2 experts, maybe this mentorship would also help to fill this gap...

@peterrehm
Copy link
Contributor

I would agree with @webmozart that the we should provide the needed tooling to make it as easy as possible to provide a reproduceable branch. This should be sufficient for most cases to reproduce the issue and get into discussion.

From my experience in the last years I would also agree with @merk about the lack of responsiveness. If we would be able to provide better support with being more responsive the symfony users will be more satisfied and the issues won't clutter up.

As of today there are 645 issues open of which 121 issues did not get a single response. This is almost 20%. I have quit some experience with symfony now, but with many issues I am able to track the error down but for a fix I would need someone to discuss and to get quick feedback when creating a PR. We should discuss what possibilities we would have to improve this. Also contributing makes most fun if you see progress and if you get issues out of the ways quickly.

@webmozart
Copy link
Contributor

I would agree with @webmozart that the we should provide the needed tooling to make it as easy as possible to provide a reproduceable branch.

What about something along the lines of:

$ app/console bug:reproduce name-of-bug /path/to/some/directory
Installing symfony-standard at /path/to/some/directory...
Do you want to remember this path for future bug reports? Y/n
Updating app/config/config_dev.yml...
Creating branch issue-name-of-bug...
Do you want to copy your Composer settings? Y/n
Installing Composer dependencies...
Done.

You can use AcmeDemoBundle to reproduce your bug.
When you are finished, please run "app/console bug:report".

app/console bug:report would then upload the symfony-standard fork and return the link which can be included in the PR. Optionally we could also include the PR creation in that command, but I think that GitHub's UI is more intuitive in that regard (preview...).

@peterrehm
Copy link
Contributor

I think the general idea is quit nice. A few things which we should consider:

  • How would we handle the version of the SE? Based on the latest version or based
    on the version the user has in its repo. I think we should go with the current version
    since a bug might be fixed meanwhile.
  • We could add the config settings and composer but do we really want to add that
    complexity to the standard process? Usually the bug should be reproducible without
    other bundles / dependencies. It will also be difficult if we go always for the latest Version
    parameters in the configuration might have changed etc.
  • When reporting the bug I think we should just push the branch to the users remote which
    he has to specify when actually reporting the bug. And the command is just returning the
    link to the repo so the user can mention this url when pushing. An implementation needs to
    check if his repository is actually public. We might also think about another name since it is
    actually not reporting a bug. Maybe the report bug command is only available in a specific
    version of SE or based on a specific configuration settings to avoid any confusion when
    working in the actual application. In this case you might push your actual application.

And I think we should encourage users to just provide a link to the repo rather than creating a
PR with the issue, this would be a mess otherwise.

I personally like @weaverryan / knpuniversity's training videos. Maybe we could also provide
a screencast about how to easily reproduce a bug and open up an issue. This could include some
information around the process and might even replace the entire tooling discussed above. If we
educate people well they should easily be able to submit a branch with the issues.

@webmozart
Copy link
Contributor

👍

@peterrehm
Copy link
Contributor

@weaverryan What do you think? Would you be interested in creating such screencast? Hopefully @Leannapelham want's to be part of this as well :)

@weaverryan
Copy link
Member

@peterrehm we'd totally be up for that :).

I think we have some ideas, we just need to decide on what tooling (if any) we want to add. I like Javier's solution (2) and I think @webmozart's bug:reproduce is a more viable version of it (i.e. having them create a working project, not just upload a few files). It would still be some work for them to bring over offending configuration+files, but maybe over time the task could help bring over some additional pieces to make it less work.

So, should we try adding some tooling? Or should we just increase the documentation? There is also a middle option: add some tooling that doesn't do much more than just help walk you through the steps (and link you to docs for more information). Regardless of what we do, the goal would be to guide the user through each step of what they need to do and not leave them "dangling" at any point (i.e. not knowing what to do next).

Thanks!

@peterrehm
Copy link
Contributor

I think it might be hard anyways to automate the process of getting a fork of SE for the user
with his settings. It might actually make more sense to improve documentation at first and educate
the users rather than automating actually a git clone. I think with this way we could tech again basics
and often if a user has no other dependencies, he might figure out, that the bug is not any more there, if its actually caused by any bundle.

If a screencast does not improve the issue reports we are getting we might consider further tooling. Anyway it will take time to get there but it will be a good reference to refer to when discussing on issues.

weaverryan added a commit to symfony/symfony-docs that referenced this issue Aug 13, 2014
… reports (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[Contributing][Code] add note on Symfony SE forks for bug reports

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

As @javiereguiluz stated in symfony/symfony#11494, the way to report bugs can be improved. One of the things that could be done, is to add a note to make a bug reproducable by forking the Symfony Standard Edition with the modifications needed to reproduce a particular issue.

Commits
-------

ebf1415 add note on Symfony SE forks for bug reports
@peterrehm
Copy link
Contributor

Any concrete feedback on tooling vs screencast/docs?

@weaverryan
Copy link
Member

Not yet :). I'd like to see if someone can find some time to experiment with something scripted (also see #11660) and see if it can make it fore 2.6. Then, I'd love to make a quick screencast to show whatever the best solution is that we land on for 2.6.

@javiereguiluz
Copy link
Member Author

For your information, Laravel has just released something like this. It's called Liferaft and works as follows:

# download a fresh new Laravel project to reproduce a bug
$ liferaft new bug_11289

# code, configure or do whatever you want

# send the reproducible fork of your app to reviewers
$ liferaft throw

# then, maintainers can download and reproduce the bug with this command
$ liferaft grab 11289

@trq
Copy link

trq commented Sep 11, 2014

This demo (for liferaft) might be of interest too: https://laracasts.com/lessons/introducing-laravel-liferaft

@peterrehm
Copy link
Contributor

This looks interesting considering homestead to make it also very easy for contributors to look at bugs. Such default dev / prod environments might make sense for Symfony as well.

We also need still to consider that we have to educate people to know what has to be done. Actually I think the advantage of such tooling is bigger for contributors than for the people submitting the issue.

What I don't like is that actual PR's are being sent to the Laravel Main repository since those are actually issues and not really code contributions. If we would consider such implementation I would send the PR to a separate repository and open up an issue on the main repository. If we use a standard issue format on the top we can still fetch the corresponding PR without any big troubles.

@ghost
Copy link

ghost commented Sep 12, 2014

filtering by label should work tho. github has made that pretty easy now. not sure a seperate repo is needed.

@peterrehm
Copy link
Contributor

I didn't make my final thought on that one. A label might be a solution, in any case "cluttering" of the PR's should be avoided. Another option would be refer just to the remote branch of the submitter with the risk of loosing the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony)
Projects
None yet
Development

No branches or pull requests