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

[FAI-14745] Process source airbyte connector output #102

Merged
merged 9 commits into from
Jan 22, 2025
Merged

Conversation

jeniii
Copy link
Contributor

@jeniii jeniii commented Jan 17, 2025

Description

Provide description here

Type of change

  • Bug fix
  • New feature
  • Breaking change

@jeniii jeniii marked this pull request as draft January 17, 2025 21:00
// Take the non-default value if provided with `srcOutputFile` option
srcOutputFile: cliOptions.srcOnly ? '/dev/null' : cliOptions.srcOutputFile,
srcOutputFile: cliOptions.srcOnly ? OutputStream.STDOUT : cliOptions.srcOutputFile,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug. this is supposed to be stdout by default

airbyte-local-cli-nodejs/src/utils.ts Outdated Show resolved Hide resolved
airbyte-local-cli-nodejs/src/docker.ts Outdated Show resolved Hide resolved
airbyte-local-cli-nodejs/src/utils.ts Outdated Show resolved Hide resolved
airbyte-local-cli-nodejs/src/utils.ts Outdated Show resolved Hide resolved
@jeniii jeniii marked this pull request as ready for review January 21, 2025 18:02
const lines = buffer.split('\n');
buffer = lines.pop() ?? '';
lines.forEach((line: string) => {
processSrcDataByLine(line, srcOutputStream, config);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processing the data and write to stdout/file instead of returning the data at the end of the function

if (cfg.rawMessages) {
process.stdout.write(`${line}\n`);
} else {
logger.info(formatSrcMsg(data));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will look like this
Screenshot 2025-01-21 at 10 16 17

// - input stream: read from the data file user provided
// - output stream: write to an intermediate file. Overwrite the file if it exists, otherwise create a new one
const inputStream = createReadStream(cfg.srcInputFile!);
const outputStream = createWriteStream(`${tmpDir}/${SRC_OUTPUT_DATA_FILE}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the user has srcInputFile configured, i assume they won't have src-only or src-output-file configured. but i will add this constraint in the command in another PR.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
79.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@jeniii jeniii merged commit b37cc6c into main Jan 22, 2025
5 of 6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2025
@jeniii jeniii deleted the jg/src-conn-output branch January 22, 2025 17:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants