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

Fix CML #1450

Merged
merged 3 commits into from
May 10, 2024
Merged

Fix CML #1450

merged 3 commits into from
May 10, 2024

Conversation

0x2b3bfa0
Copy link
Member

Miscellaneous changes needed to push a new CML release

@0x2b3bfa0 0x2b3bfa0 self-assigned this May 10, 2024
TEST_BBCLOUD_REPO: https://bitbucket.org/iterative-ai/cml-qa-tests-dummy
TEST_BBCLOUD_SHA: b511535a89f76d3d311b1c15e3e712b15c0b94e3
TEST_BBCLOUD_ISSUE: 1
TEST_BITBUCKET_TOKEN: ${{ secrets.TEST_BITBUCKET_TOKEN }}
Copy link
Member Author

@0x2b3bfa0 0x2b3bfa0 May 10, 2024

Choose a reason for hiding this comment

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

Rename nonsensical variables, for the sake of beauty

Copy link
Member Author

@0x2b3bfa0 0x2b3bfa0 May 10, 2024

Choose a reason for hiding this comment

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

Move all the logger setup code to a separate file, so it can be invoked properly before each test, avoiding tons of messages like this clogging the console output:

    console.error
      [winston] Attempt to write logs with no transports, which can increase memory usage: {"message":"POST /repos/iterative/cml_qa_tests_dummy/actions/runners/registration-token - 201 in 209ms","level":"info"}

      at DerivedLogger._transform (node_modules/winston/lib/winston/logger.js:302:15)
      at DerivedLogger.Object.<anonymous>.Transform._read (node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:177:10)
      at DerivedLogger.Object.<anonymous>.Transform._write (node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:164:83)
      at doWrite (node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:409:139)
      at writeOrBuffer (node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:398:5)
      at DerivedLogger.Object.<anonymous>.Writable.write (node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:307:11)
      at DerivedLogger.<computed> [as info] (node_modules/winston/lib/winston/create-logger.js:81:14)
      at Object.exports.<computed> [as info] (node_modules/winston/lib/winston.js:110:68)

Comment on lines +28 to +30
if (typeof jest !== 'undefined') {
setupLogger({ log: 'debug', silent: true });
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Disable logger output when running jest tests, to avoid spamming developers.

Comment on lines +156 to +161
if (runnersToken === null) {
if (!body) body = new URLSearchParams();
body.append('project_id', id);
body.append('runner_type', 'project_type');
return (await this.request({ endpoint, method: 'POST', body })).token;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

GitLab decided to change the way of registering runners, breaking the old approach; now we support both for good measure, and "infer [sic] which to use automatically" like in the good ol' CML times. 🙃

https://docs.gitlab.com/ee/ci/runners/new_creation_workflow.html

Comment on lines +84 to +87
if (new Date() > new Date('2024-01-01')) {
logger.error('TensorBoard.dev has been shut down as of January 1, 2024');
return;
}
Copy link
Member Author

@0x2b3bfa0 0x2b3bfa0 May 10, 2024

Choose a reason for hiding this comment

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

TensorBoard.dev has been shut down as of January 1, 2024; yes, they don't exist anymore, rendering this command pointless (and untestable). Still, leaving the dead code for the sake of good memories.

@0x2b3bfa0
Copy link
Member Author

0x2b3bfa0 commented May 10, 2024

Pointless to ask for reviews on this; at 3:25 on the early morning Mr. Hyde feels like using BDFL powers.

@0x2b3bfa0 0x2b3bfa0 merged commit 24ca0df into main May 10, 2024
14 of 15 checks passed
@0x2b3bfa0 0x2b3bfa0 deleted the remove-rust branch May 10, 2024 01:23
@0x2b3bfa0 0x2b3bfa0 requested a review from a team May 10, 2024 01:23
Comment on lines -37 to -49
test('cml send-comment to current repo', async () => {
const report = `## Test Comment`;

await fs.writeFile(path, report);
await exec('node', './bin/cml.js', 'send-comment', path);
});

test('cml send-comment --publish to current repo', async () => {
const report = `## Test Comment\n![](assets/logo.png)`;

await fs.writeFile(path, report);
await exec('node', './bin/cml.js', 'send-comment', '--publish', path);
});
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll miss this spam on every single CML pull request. 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant