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

ci: improve logging for tools build script #1128

Merged
merged 7 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/regenerate-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: "15 0 * * 1"

jobs:
meetings:
regenerateTools:
if: github.repository == 'asyncapi/website'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions scripts/tools/tools-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ async function convertTools(data) {
}
});
} else {
console.log("Repository: " + tool.repository.html_url)
console.log("Error: " + validate.errors)
console.error('Invalid .asyncapi-tool file.');
console.error(`Located in: ${tool.html_url}`);
Copy link
Member

Choose a reason for hiding this comment

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

Checking code, it should be probably:

Suggested change
console.error(`Located in: ${tool.html_url}`);
console.error(`Located in: ${tool.repository.html_url}`);

or am I wrong?

Copy link
Member

@akshatnema akshatnema Nov 30, 2022

Choose a reason for hiding this comment

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

Yeah, from my perspective, certain users are making .asyncapi-tool files inside any subdirectories. If we want to locate the wrong file, it may occur that we get into trouble finding the file inside the repository sub-directories. Hence, using tool.html_url is the best link to directly hop into the file in the respective repository to see the errors, instead using the repository's URL. WDYT @magicmatatjahu @derberg ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@akshatnema you are right, tool.html_url provides direct URL to the file

@magicmatatjahu changed

folks, please approve

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I was looking at the code and we used a different field. Approved :)

console.error('Validation errors:', JSON.stringify(validate.errors, null, 2));
console.error('Not failing, dropping errors for further investigation');
}
}
}
Expand Down