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

Add tests for requesting to join project #1410

Merged
merged 13 commits into from
Jan 31, 2025
Prev Previous commit
Next Next commit
Fix tests on GHA
rmunn committed Jan 29, 2025
commit 45a484e09849dcef5b9f6e967bbcd7a664a1760b
2 changes: 1 addition & 1 deletion frontend/tests/fixtures.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import {isDev} from './envVars';
import {E2EMailboxApi} from './email/e2e-mailbox-module-patched';
import {MaildevMailbox} from './email/maildev-mailbox';
import {E2EMailbox} from './email/e2e-mailbox';
import {OrgRole} from '$lib/gql/types';
import {OrgRole} from '../src/lib/gql/types';

export interface TempUser {
id: UUID

Unchanged files with check annotations Beta

}
catch (Exception e)
{
Activity.Current?.RecordException(e);

Check warning on line 121 in backend/SyncReverseProxy/ProxyKernel.cs

GitHub Actions / Build API / publish-api

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'

Check warning on line 121 in backend/SyncReverseProxy/ProxyKernel.cs

GitHub Actions / GHA integration tests / execute

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'
//we don't want to throw errors from the post process event
}
}
LexBoxDbContext lexBoxDbContext,
IOptions<DbConfig> dbConfig,
IHostEnvironment environment,
ILogger<SeedingData> logger,

Check warning on line 18 in backend/LexData/SeedingData.cs

GitHub Actions / Build API / publish-api

Parameter 'logger' is unread.

Check warning on line 18 in backend/LexData/SeedingData.cs

GitHub Actions / GHA integration tests / execute

Parameter 'logger' is unread.
IOpenIddictApplicationManager? applicationManager = null)
{
public static readonly Guid TestAdminId = new("cf430ec9-e721-450a-b6a1-9a853212590b");
namespace LexBoxApi.Hub;
public class CrdtProjectChangeHub(LoggedInContext loggedInContext, IPermissionService permissionService) : Hub<IProjectChangeListener>

Check warning on line 8 in backend/LexBoxApi/Hub/CrdtProjectChangeHub.cs

GitHub Actions / Build API / publish-api

Parameter 'loggedInContext' is unread.

Check warning on line 8 in backend/LexBoxApi/Hub/CrdtProjectChangeHub.cs

GitHub Actions / GHA integration tests / execute

Parameter 'loggedInContext' is unread.
{
public static string ProjectGroup(Guid projectId) => $"project-{projectId}";
catch (Exception e)
{
logger.LogError(e, "Error parsing user from claims principal");
Activity.Current?.RecordException(e);

Check warning on line 24 in backend/LexBoxApi/Auth/LoggedInContext.cs

GitHub Actions / Build API / publish-api

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'

Check warning on line 24 in backend/LexBoxApi/Auth/LoggedInContext.cs

GitHub Actions / GHA integration tests / execute

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'
}
return null;
}
catch (Exception e)
{
activity?.RecordException(e);

Check warning on line 58 in backend/LexBoxApi/Jobs/LexJob.cs

GitHub Actions / Build API / publish-api

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'

Check warning on line 58 in backend/LexBoxApi/Jobs/LexJob.cs

GitHub Actions / GHA integration tests / execute

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'
throw new JobExecutionException(e);
}
}
public static AuthenticationTicket? ConvertJwtToAuthTicket(string? protectedText, JwtBearerOptions jwtBearerOptions, ILogger logger)
{
var validationParameters = jwtBearerOptions.TokenValidationParameters.Clone();
foreach (var validator in jwtBearerOptions.SecurityTokenValidators)

Check warning on line 122 in backend/LexBoxApi/Auth/JwtTicketDataFormat.cs

GitHub Actions / Build API / publish-api

'JwtBearerOptions.SecurityTokenValidators' is obsolete: 'SecurityTokenValidators is no longer used by default. Use TokenHandlers instead. To continue using SecurityTokenValidators, set UseSecurityTokenValidators to true. See https://aka.ms/aspnetcore8/security-token-changes'

Check warning on line 122 in backend/LexBoxApi/Auth/JwtTicketDataFormat.cs

GitHub Actions / GHA integration tests / execute

'JwtBearerOptions.SecurityTokenValidators' is obsolete: 'SecurityTokenValidators is no longer used by default. Use TokenHandlers instead. To continue using SecurityTokenValidators, set UseSecurityTokenValidators to true. See https://aka.ms/aspnetcore8/security-token-changes'
{
try
{
}
catch (Exception e)
{
activity?.RecordException(e);

Check warning on line 238 in backend/LexBoxApi/Services/EmailService.cs

GitHub Actions / Build API / publish-api

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'

Check warning on line 238 in backend/LexBoxApi/Services/EmailService.cs

GitHub Actions / GHA integration tests / execute

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'
activity?.SetStatus(ActivityStatusCode.Error);
throw;
}
{
var hash = await GetTipHash(code, timeoutSource.Token);
var isEmpty = hash == AllZeroHash;
done = expectedState switch

Check warning on line 460 in backend/LexBoxApi/Services/HgService.cs

GitHub Actions / Build API / publish-api

The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value. For example, the pattern '(LexBoxApi.Services.RepoEmptyState)2' is not covered.

Check warning on line 460 in backend/LexBoxApi/Services/HgService.cs

GitHub Actions / GHA integration tests / execute

The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value. For example, the pattern '(LexBoxApi.Services.RepoEmptyState)2' is not covered.
{
RepoEmptyState.Empty => isEmpty,
RepoEmptyState.NonEmpty => !isEmpty
public async Task<ActionResult<RefreshResponse>> GetProjectToken(string projectCode)
{
var projectId = await projectService.LookupProjectId(projectCode);
if (projectId == default) return NotFound();

Check warning on line 62 in backend/LexBoxApi/Controllers/IntegrationController.cs

GitHub Actions / Build API / publish-api

Action method returns undeclared status code '404'

Check warning on line 62 in backend/LexBoxApi/Controllers/IntegrationController.cs

GitHub Actions / GHA integration tests / execute

Action method returns undeclared status code '404'
return GetRefreshResponse(projectId);
}
{
return await MongoExtensions.ToAsyncEnumerable(loader._systemDbContext.Projects.AsQueryable()
.Select(p => p.ProjectCode)
.Where(projectCode => list.Contains(projectCode)))

Check warning on line 64 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs

GitHub Actions / Build API / publish-api

Method referencing lambda parameter is not supported LINQ expression. (https://www.mongodb.com/docs/mongodb-analyzer/current/rules/#MALinq2001)

Check warning on line 64 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs

GitHub Actions / GHA integration tests / execute

Method referencing lambda parameter is not supported LINQ expression. (https://www.mongodb.com/docs/mongodb-analyzer/current/rules/#MALinq2001)
.ToDictionaryAsync(projectCode => projectCode, _ => true, token);
}