Να ρωτήσω, best practice για core/module patches σ...
# chat
e
Να ρωτήσω, best practice για core/module patches στον composer, όταν οι αλλαγές έχουν ανέβει κατευθείαν στο gitlab ως merge request, και όχι με τον παλιό τρόπο?
Εννοώ ποιος είναι ο καλύτερος/ασφαλέστερος τρόπος να μπει στο composer.patches.json (ή στο composer.json, ανάλογα το configuration)
d
το πιο σύνηθες είναι να μπει το MR diff σαν patch Αλλά εκεί ρισκάρεις με το ότι μπορεί κάποιος να κάνει commit κάτι και να χαλάσει το patch.
e
ναι ακριβώς
d
Οπότε παίρνεις το diff σε local level, γράφεις στο filename μέχρι ποιο commit είναι και το περνάς έτσι
e
ίσως αν το gitlab δίνει diff μεταξύ commit και tag σαν url να βολεύει
d
πχ https://git.drupalcode.org/project/webform/-/compare/6.2.0...6.2.x?from_project_id=59750&straight=false δεν βλεπω να υπαρχει η επιλογη να παρεις raw diff
In both cases, download the patch file to your site’s codebase and add the path to the patch file to your
composer.json
file.
αυτος ειναι ο επισημος τροπος
ενίωτε εγώ βαζω το patch-file στο issue, για να πάρει ID και ημερομηνια, και να φαινεται αν προκυψουν νεα commits
και για να το κανω και πιο ευκολο για τους αλλους, ή εμενα σε αλλο project
The contents of merge request patch file will change as commits are pushed!
This means that you will get the latest version of the code from an issue. So, it brings a security risk because any new commit to the issue’s branch will be automatically deployed to your site when composer runs.
It's strongly recommended to lock the patch file versions on production sites. To do so you must download the patch file and use it in composer from a local directory. If you use the URL to the Gitlab MR directly, your codebase will change without warning, as people work on the merge request.
m
Μπορείς πάντα να ανεβάσεις το patch που θα βγάλεις στο issue
Πλέον το έχουν φτιάξει καλά και τα αρχεία που ανεβάζεις δεν δίνουν credit αν δεν έχει σοβαρά changes, οπότε δεν θα έχει κανείς θέμα νομίζω
Και χρησιμοποιείς κανονικά το url από εκεί... αν για κάποια λόγο δεν θέλεις να έχεις local αρχείο
e
Ευχαριστώ πολύ για τις απαντήσεις
k
και εγώ για την πολύ ενδιαφέρουσα κουβέντα