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

magento core/modules mapped per-file are not appended to gitignore #175

Open
gganchev opened this issue Jan 4, 2015 · 6 comments
Open

Comments

@gganchev
Copy link

gganchev commented Jan 4, 2015

So, I have some modules (including core) mapped on a file-per-file base and not as folders. I started a new project today and nothing got added to the .gitignore file. After some poking around I found out the following:

  1. in MagentoHackathon/Composer/Magento/DeployManager.php the $eventManager property has no events in it and therefore the post-package-deploy dispatch does nothing
  2. in MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php when there's a file-to-file copy the files are not added to the deployed files and therefore even if the event is properly added the files do not get appended to the .gitignore file.

Since I needed it working I hacked it by manually adding the event listener for post-package-deploy and also by modifying the code so that it also adds deployed files when it does file-to-file copy.

P.S. I might be using the whole thing "wrong", but the situation seemed as an issue and not as an intended behavior.

Thank you for your time.

@Flyingmana
Copy link
Member

could you please note which version you use?

did you follow the documentation and added "auto-append-gitignore": true to your project composer.json?

@gganchev
Copy link
Author

gganchev commented Jan 4, 2015

Hi there. Thank you for your reply!

So:
git rev-parse --short HEAD
5a6f7ee

I have the "auto-append-gitignore": true inside the "extra" of the composer.json of the magento project.

@Flyingmana
Copy link
Member

could you maybe provide a full composer.json, so I can reproduce this issue local?

@AydinHassan
Copy link
Member

I've created a PR to fix the second part of your issue. I guess for the first part you are using the deploy command @gganchev ? The GitIgnore listener is not attached there.

Appreciate that this new stuff is not 100% stable yet hence it only being available in master :D

@Flyingmana
Copy link
Member

I still would like to have a composer.json to reproduce, so I can add a regression test for this issue

@gganchev
Copy link
Author

gganchev commented Jan 5, 2015

Hi.
My bad there, @AydinHassan - I should have specified I was using the deploy command and not the "usual" flow. Also - I hope you didn't get me wrong - I am not complaining, just mentioning what seemed to me to be an issue :)

@Flyingmana here's my composer.json:

{
  "name": "project/name",
  "authors": [
    {
      "name": "Georgi Ganchev",
      "email": "my@email.com"
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "http://packages.firegento.com"
    },
    {
      "type": "composer",
      "url": "http://personal.satis_repo.com"
    }
  ],
  "require": {
    "composer/composer": "*@dev",
    "magento-hackathon/composer-command-integrator": "*",
    "magento-hackathon/magento-composer-installer": "dev-master",
    "personal_magento_core/module": "1.9.1.0",
    "another/module": "0.3.2",
    "another/module": "2.0.0",
    "another/module": "1.1.4.1",
    "another/moduyle": "1.3.2.1",
    "another/module": "0.2.0",
    "another/module": "dev-master",
    "another/module": "dev-master",
    "another/module": "dev-master",
    "another/module": "dev-master",
    "another/module": "dev-master"
  },
  "extra": {
    "auto-append-gitignore": true,
    "magento-deploystrategy": "copy",
    "magento-force": "override",
    "magento-root-dir": "./"
  }
}

And that's the composer.json of the magento core package:

{
    "name": "personal_magento_core/module",
    "description": "Magento Core Files 1.9.1.0",
    "type": "magento-module",
    "extra": {
        "magento-deploystrategy": "copy",
        "auto-append-gitignore": true
    },
    "require": {}
}

A bit more info - when I am initializing the project (composer install) for some reason the magento-hackathon modules get installed last (or at least after some of the other modules) so, naturally - the deploy does not run for those modules that got installed before. And that is why I had to run it manually.
I suppose that can be resolved by introducing dependency in my modules so that the magento-hackathon ones will get installed before.

Edit:
P.S. I am using modman file for mapping if that is of any relevance.

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

No branches or pull requests

3 participants