- Issue created by @urvashi_vora
- Status changed to Needs work
about 1 year ago 6:11am 25 October 2023 - ๐ฎ๐ณIndia Ashutosh Ahirwal India
Provided patch is not working.
Throwing error while applying patch.git apply -v coding-standard-fixes_3.patch
coding-standard-fixes_3.patch:10: trailing whitespace.
* Shyamlal Sawhney (shyam-sawhney) - https://www.drupal.org/u/shyam-sawhney โ /
Checking patch README.md...
error: while searching for:
-----------Current maintainers:
* Shyamlal Sawhney (shyam-sawhney) - https://www.drupal.org/u/shyam-sawhney โ / developed by
* Nico Grienauer (Grienauer) - https://www.drupal.org/u/grienauer โerror: patch failed: README.md:50
error: README.md: patch does not apply
Checking patch sidekick.module...
error: while searching for:
<?phpuse Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Url;error: patch failed: sidekick.module:1
error: sidekick.module: patch does not apply
Checking patch sidekick.services.yml...
error: while searching for:
services:
sidekick.service:
class: Drupal\sidekick\SidekickService
arguments: ['@http_client']error: patch failed: sidekick.services.yml:1
error: sidekick.services.yml: patch does not apply
Checking patch src/Controller/SidekickController.php...
error: while searching for:
protected $configManager;/**
* @param \Drupal\Core\Session\AccountInterface $account
* @param \Drupal\Core\Language\LanguageManagerInterface $language
* @param \Drupal\Core\Config\ConfigManagerInterface $configManager
*/
public function __construct(AccountInterface $account, LanguageManagerInterface $language, ConfigManagerInterface $configManager) {
$this->account = $account;error: patch failed: src/Controller/SidekickController.php:39
error: src/Controller/SidekickController.php: patch does not apply
Checking patch src/Form/SettingsForm.php...
error: while searching for:
'#type' => 'textfield',
'#title' => $this->t('API Key'),
'#default_value' => $this->config('sidekick.settings')->get('api_key'),
'#required' => TRUE
];
$form['display_type'] = [
'#type' => 'select',
'#options' => [
'inline' => $this->t('Inline'),
'modal' => $this->t('Modal')
],
'#title' => $this->t('Display type'),
'#default_value' => $this->config('sidekick.settings')->get('display_type')
];return parent::buildForm($form, $form_state);
error: patch failed: src/Form/SettingsForm.php:37
error: src/Form/SettingsForm.php: patch does not apply
Checking patch src/SidekickService.php...
error: while searching for:
*
* @var \GuzzleHttp\ClientInterface
*/
protected $http_client;/**
* @var $key_status_api
*/
protected $key_status_api;/**
* Constructs a SidekickService object.
*
* @param \GuzzleHttp\ClientInterface $http_client
* The HTTP client.
*/
public function __construct(ClientInterface $http_client) {
$this->http_client = $http_client;
$this->key_status_api = 'https://assistant.ai-sidekick.app/api/v1/apikey-status';
}/**
* @param $api_key
* @param $language_code
* @return array|mixed
*/
public function checkKeyStatus($api_key, $language_code) {
try {
$response = $this->http_client->post($this->key_status_api, [
'headers' => [
'Content-Type' => 'application/json',
],
'body' => json_encode([
'token' => $api_key,
'language' => $language_code
])
]);$statusCode = $response->getStatusCode();
return $apiResponse = ['status' => $statusCode, 'message' => json_decode($response->getBody())];} catch (ClientException|RequestException|TransferException|BadResponseException $exception) {
watchdog_exception('sidekick', $exception, NULL, [], 6);return json_decode((string)$exception->getResponse()->getBody());
}
}
}
error: patch failed: src/SidekickService.php:17
error: src/SidekickService.php: patch does not apply - ๐ฎ๐ณIndia zkhan.aamir
zkhan.aamir โ made their first commit to this issueโs fork.
- Status changed to Needs review
about 1 year ago 11:22am 16 November 2023 - Status changed to Needs work
about 1 year ago 6:42am 23 November 2023 - ๐ต๐ญPhilippines clarkssquared
Hi
I was about to apply and test the MR !3 in my local but it seems that it doesn't apply properly, I used two method on how to apply patch and both seems to fail.
โ sidekick git:(master) โ curl https://git.drupalcode.org/project/sidekick/-/merge_requests/3.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 46098 0 46098 0 0 89522 0 --:--:-- --:--:-- --:--:-- 90923 patching file README.md 2 out of 2 hunks failed--saving rejects to README.md.rej patching file sidekick.module No such line 96 in input file, ignoring 15 out of 15 hunks failed--saving rejects to sidekick.module.rej patching file 'src/Controller/SidekickController.php' 1 out of 1 hunks failed--saving rejects to 'src/Controller/SidekickController.php.rej' patching file 'src/Form/SettingsForm.php' No such line 106 in input file, ignoring 9 out of 9 hunks failed--saving rejects to 'src/Form/SettingsForm.php.rej' File to patch: No file found--skip this patch? [y] 8 out of 8 hunks ignored--saving rejects to Oops.rej patching file 'src/SidekickService.php' No such line 66 in input file, ignoring 10 out of 10 hunks failed--saving rejects to 'src/SidekickService.php.rej' โ sidekick git:(master) โ curl https://git.drupalcode.org/project/sidekick/-/merge_requests/3.diff | git apply -v % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 46098 0 46098 0 0 73311 0 --:--:-- --:--:-- --:--:-- 74231 Skipped patch 'README.md'. Skipped patch 'sidekick.module'. Skipped patch 'src/Controller/SidekickController.php'. Skipped patch 'src/Form/SettingsForm.php'. Skipped patch 'src/ImageWidget.php'. Skipped patch 'src/SidekickService.php'. โ sidekick git:(master) โ
Please advise
- Assigned to nitin_lama
- Issue was unassigned.
- ๐ฎ๐ณIndia nitin_lama India
This needs a new MR or changes in the MR.
- ๐ฎ๐ณIndia zkhan.aamir
Hi
MR #7 does not apply successfully.
Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/sidekick (1.0.x) $ curl https://git.drupalcode.org/project/sidekick/-/merge_requests/3.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48323 0 48323 0 0 106k 0 --:--:-- --:--:-- --:--:-- 106k patching file README.md patching file sidekick.module Hunk #2 FAILED at 14. Hunk #3 succeeded at 71 (offset -3 lines). Hunk #4 FAILED at 102. Hunk #5 succeeded at 122 (offset -3 lines). Hunk #6 FAILED at 150. Hunk #7 succeeded at 173 (offset -1 lines). Hunk #8 succeeded at 182 (offset -1 lines). Hunk #9 succeeded at 199 (offset -1 lines). Hunk #10 succeeded at 228 (offset -1 lines). Hunk #11 succeeded at 277 (offset -1 lines). Hunk #12 FAILED at 290. Hunk #13 succeeded at 353 (offset 8 lines). Hunk #14 succeeded at 394 (offset 8 lines). Hunk #15 succeeded at 405 (offset 8 lines). 4 out of 15 hunks FAILED -- saving rejects to file sidekick.module.rej patching file src/Controller/SidekickController.php patching file src/Form/SettingsForm.php Hunk #6 succeeded at 163 (offset 1 line). Hunk #7 succeeded at 196 (offset 1 line). patching file src/ImageWidget.php patching file src/SidekickService.php Hunk #1 FAILED at 6. Hunk #2 succeeded at 20 (offset 1 line). Hunk #3 FAILED at 64. Hunk #4 FAILED at 130. Hunk #5 succeeded at 245 (offset 10 lines). Hunk #6 succeeded at 267 (offset 10 lines). Hunk #7 succeeded at 285 with fuzz 2 (offset 10 lines). 3 out of 7 hunks FAILED -- saving rejects to file src/SidekickService.php.rej