-
Notifications
You must be signed in to change notification settings - Fork 13
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
[RND-623] initial matchup to MetaEd api-schema plugin #300
Conversation
0f73541
to
607eb6a
Compare
7b37aaf
to
705309c
Compare
@@ -12,16 +12,19 @@ import { | |||
AuthorizationStrategy, | |||
TraceId, | |||
ResourceInfo, | |||
MetaEdProjectName, | |||
MetaEdResourceName, | |||
SemVer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More branded strings to avoid getting them confused
@@ -15,7 +15,12 @@ export const setupConfigForIntegration = async () => { | |||
return; | |||
} | |||
|
|||
const path = join(process.cwd(), '.env'); | |||
// First look for .env file paired with this Config.ts file | |||
let path = join(__dirname, '.env'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow for different .envs in each backend rather than force one big .env at root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this
}; | ||
|
||
const referencedDocumentInfo: DocumentInfo = { | ||
...newDocumentInfo(), | ||
documentIdentity: { natural: 'delete5' }, | ||
documentIdentity: [{ natural: 'delete5' }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document identity structure changed to enforce ordering
expect(result.outboundRefs).toMatchInlineSnapshot(` | ||
[ | ||
"QtykK4uDYZK7VOChNxRsMDtOcAu6a0oe9ozl2Q", | ||
"QtykK4uDYZK7VOChzZNTfqxhrlznYfnql5kIHg", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MeadowlarkIds changed due to DocumentIdentity changing to enforce ordering
@@ -90,12 +97,12 @@ export interface MeadowlarkDocument extends MeadowlarkDocumentId { | |||
*/ | |||
export function newMeadowlarkDocument(): MeadowlarkDocument { | |||
return { | |||
meadowlark_id: undefined as unknown as MeadowlarkId, | |||
document_uuid: undefined as unknown as DocumentUuid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just wrong
@@ -9,9 +9,17 @@ import { CachedEnvironmentConfigProvider, Config } from '@edfi/meadowlark-utilit | |||
import { join } from 'path'; | |||
|
|||
export const setupConfigForIntegration = async () => { | |||
const path = join(process.cwd(), '.env'); | |||
// First look for .env file paired with this Config.ts file | |||
let path = join(__dirname, '.env'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow for different .envs in each backend rather than force one big .env at root
throw new Error('Cannot run integration tests because there is no .env file in the repository root directory.'); | ||
// eslint-disable-next-line no-console | ||
console.error(`Cannot run integration tests because there is no .env file in '${path}'`); | ||
process.exit(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency with mongodb's setup
"jest": "^29.7.0", | ||
"jest-environment-node": "^29.7.0", | ||
"kafkajs": "^2.2.4", | ||
"lerna": "^6.6.2", | ||
"mongodb": "^5.9.0", | ||
"pg": "^8.11.3", | ||
"pg-format": "^1.0.4", | ||
"prettier": "3.0.3", | ||
"prettier": "2.8.8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier 3.x not compatible with latest Jest's inline snapshot writing
static readonly uriVersion33b: string = 'v3.3b'; | ||
|
||
static readonly projectVersion33b: string = '3.3.1-b'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplifying this
method: string, | ||
statusCode?: number, | ||
message?: string, | ||
extra?: any, | ||
): void { | ||
if (isDebugEnabled()) { | ||
Logger.debug(`${moduleName}.${method} ${statusCode ?? ''} ${message ?? ''}`.trimEnd(), request.traceId, extra); | ||
Logger.debug(`${moduleName}.${method} ${statusCode ?? ''} ${message ?? ''}`.trimEnd(), traceId, extra); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplifying
|
||
const moduleName = 'ApiSchemaFinder'; | ||
|
||
const dataStandard50pre1Path: string = path.resolve(__dirname, '../ds-schemas/DataStandard-5.0.0-pre.1.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded to DS 5.0-pre.1 right now
): Promise<DocumentInfo> { | ||
const documentIdentity: DocumentIdentity = extractDocumentIdentity(matchingMetaEdModel, body); | ||
): DocumentInfo { | ||
const documentIdentity: DocumentIdentity = extractDocumentIdentity(resourceSchema, body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the extractors are rewritten, probably easier to look at them directly rather than try to follow the diff
*/ | ||
export async function metaed(_frontendRequest: FrontendRequest): Promise<FrontendResponse> { | ||
const modelNpmPackage = modelPackageFor(Constants.uriVersion33b); | ||
const { metaEd, metaEdConfiguration } = await loadMetaEdState(modelNpmPackage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MetaEd is removed
|
||
// TODO: See RND-382 on what to do with this | ||
function versionAbbreviationFor(_resourceVersion: SemVer): ProjectShortVersion { | ||
return '3.3b' as ProjectShortVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping this for now, RND-382 will probably change to '5.0.0-pre.1' for existing hardcode.
Meadowlark-js/packages/meadowlark-core/test/validation/DocumentValidator.test.ts.ignore
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment for this file. Should it be renamed? or removed?
No description provided.