Skip to content

Commit

Permalink
Merge branch 'main' into GL-2039
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkska authored Feb 27, 2024
2 parents 51e08a2 + 54694fb commit f50c6e7
Show file tree
Hide file tree
Showing 19 changed files with 260 additions and 177 deletions.
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/support-request.md

This file was deleted.

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/support_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Support request
about: Ask questions and get help
title: ''
labels: support
assignees: ''

---

**Describe the issue**
A clear and concise description of the issue.

**Impact**
What is the impact of this issue on your business or application? e.g., is it blocking deployments, destroying data, or just a nuisance?

**Time sensitivity**
Does this issue have a fixed deadline to address?

**Where does the issue occur?**
Please provide your Acquia CLI version, any log output after running the command with the verbose flag (-vvv), and information on the environment where you are running the application (e.g., locally or in Acquia Cloud)
5 changes: 2 additions & 3 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ jobs:
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
# Explicitly specify GitHub logger since our Stryker reporting will otherwise disable it.
php vendor/bin/infection -j8 --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --only-covered
php vendor/bin/infection --threads=max --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --only-covered
- name: Run Infection for all files
if: github.event_name == 'push'
env:
INFECTION_DASHBOARD_API_KEY: ${{ secrets.INFECTION_DASHBOARD_API_KEY }}
run: |
php vendor/bin/infection -j8 --only-covered
run: composer mutation
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
"box-compile": [
"php var/box.phar compile"
],
"infection": [
"php -d pcov.enabled=1 vendor/bin/infection --threads=8"
"mutation": [
"infection --threads=max --only-covered"
],
"cs": "phpcs",
"cbf": "phpcbf",
Expand Down
74 changes: 37 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions infection.json

This file was deleted.

19 changes: 19 additions & 0 deletions infection.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "vendor/infection/infection/resources/schema.json",
"source": {
"directories": [
"src"
]
},
"logs": {
"stryker": {
"report": "main"
},
"html": "var/infection.html"
},
"mutators": {
"@default": true
},
"timeout": 300,
"testFrameworkOptions": "--exclude-group=serial"
}
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
executionOrder="random"
>
<php>
<env name="AMPLITUDE_KEY" value=""/>
Expand Down
11 changes: 7 additions & 4 deletions src/Command/Api/ApiCommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,16 @@ private function getParameterSchemaFromSpec(string $paramKey, array $acquiaCloud
return $acquiaCloudSpec['components']['schemas'][$paramKey];
}

/** @infection-ignore-all */
private function isApiSpecChecksumCacheValid(\Symfony\Component\Cache\CacheItem $cacheItem, string $acquiaCloudSpecFileChecksum): bool {
// If the spec file doesn't exist, assume cache is valid.
if ($cacheItem->isHit() && !$acquiaCloudSpecFileChecksum) {
if (!$acquiaCloudSpecFileChecksum && $cacheItem->isHit()) {
return TRUE;
}
// If there's an invalid entry OR there's no entry, return false.
if (!$cacheItem->isHit() || ($cacheItem->isHit() && $cacheItem->get() !== $acquiaCloudSpecFileChecksum)) {
if (!$cacheItem->isHit() || $cacheItem->get() !== $acquiaCloudSpecFileChecksum) {
return FALSE;
}

return TRUE;
}

Expand All @@ -296,6 +296,7 @@ private function isApiSpecChecksumCacheValid(\Symfony\Component\Cache\CacheItem
private function getCloudApiSpec(string $specFilePath): array {
$cacheKey = basename($specFilePath);
$cache = new PhpArrayAdapter(__DIR__ . '/../../../var/cache/' . $cacheKey . '.cache', new NullAdapter());
/** @infection-ignore-all */
$cacheItemChecksum = $cache->getItem($cacheKey . '.checksum');
$cacheItemSpec = $cache->getItem($cacheKey);

Expand All @@ -306,6 +307,7 @@ private function getCloudApiSpec(string $specFilePath): array {

// Otherwise, only use cache when it is valid.
$checksum = md5_file($specFilePath);
/** @infection-ignore-all */
if ($this->useCloudApiSpecCache()
&& $this->isApiSpecChecksumCacheValid($cacheItemChecksum, $checksum) && $cacheItemSpec->isHit()
) {
Expand All @@ -325,13 +327,13 @@ private function getCloudApiSpec(string $specFilePath): array {
}

/**
* @param array $acquiaCloudSpec
* @return ApiBaseCommand[]
*/
private function generateApiCommandsFromSpec(array $acquiaCloudSpec, string $commandPrefix, CommandFactoryInterface $commandFactory): array {
$apiCommands = [];
foreach ($acquiaCloudSpec['paths'] as $path => $endpoint) {
// Skip internal endpoints. These shouldn't actually be in the spec.
/** @infection-ignore-all */
if (array_key_exists('x-internal', $endpoint) && $endpoint['x-internal']) {
continue;
}
Expand All @@ -346,6 +348,7 @@ private function generateApiCommandsFromSpec(array $acquiaCloudSpec, string $com
}

// Skip deprecated endpoints.
/** @infection-ignore-all */
if (array_key_exists('deprecated', $schema) && $schema['deprecated']) {
continue;
}
Expand Down
5 changes: 5 additions & 0 deletions src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,10 @@ protected static function getThisCloudIdeLabel(): false|string {
return getenv('REMOTEIDE_LABEL');
}

protected static function getThisCloudIdeWebUrl(): false|string {
return getenv('REMOTEIDE_WEB_HOST');
}

protected function getCloudApplication(string $applicationUuid): ApplicationResponse {
$applicationsResource = new Applications($this->cloudApiClientService->getClient());
return $applicationsResource->get($applicationUuid);
Expand Down Expand Up @@ -1745,6 +1749,7 @@ protected function waitForNotificationToComplete(Client $acquiaCloudClient, stri
$notification = NULL;
$checkNotificationStatus = static function () use ($notificationsResource, &$notification, $uuid): bool {
$notification = $notificationsResource->get($uuid);
/** @infection-ignore-all */
return $notification->status !== 'in-progress';
};
if ($success === NULL) {
Expand Down
1 change: 1 addition & 0 deletions src/Command/Email/ConfigurePlatformEmailCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private function checkIfDomainVerified(
return TRUE;
}

/** @infection-ignore-all */
if (isset($response->health) && str_starts_with($response->health->code, "4")) {
$this->io->error($response->health->details);
if ($this->io->confirm('Would you like to refresh?')) {
Expand Down
Loading

0 comments on commit f50c6e7

Please sign in to comment.