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

Blue hawk demo #1197

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Blue hawk demo #1197

wants to merge 5 commits into from

Conversation

ngrayluna
Copy link
Contributor

@ngrayluna ngrayluna commented Mar 17, 2025

  • Removes code from markdown file and moves it to code_examples/source.
  • Uses Blue Hawk to parse the script into snippets using code snippets and Blue Hawk CLI. Those snippets are then injected into markdown files. For example, suppose you have a file called quickstart.py:
{{< code language="python" source="/code_examples/snippets/quickstart.snippet.all.py" >}}

Where quickstart refers to the file name and all refers to the code block comment + title

  # :snippet-start: all
  import wandb
  import random
  # :snippet-end: all

This PR also adds a GitHub Action that checks:

  1. You can install libraries used in scripts successfully check_dependencies.sh
  2. Files stored in code_examples/source run successfully. It uses matrix to check files in parallel.

This is a WIP PR. Not ready for reviews just yet while I still demo, configure.

Known to-dos:

  1. Configure wandb API key for checks. See this line in error message.

johndmulhausen and others added 2 commits March 17, 2025 16:56
Suggestions are drifting from the originating lines; added more logic to
ensure the suggestions line up properly
@ngrayluna ngrayluna added WIP DO-NOT-MERGE For PRs that should not be merged yet labels Mar 17, 2025
@ngrayluna ngrayluna requested a review from a team as a code owner March 17, 2025 23:37
Copy link

socket-security bot commented Mar 17, 2025

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] Transitive: environment, shell +142 229 MB dmitryduev, jhr, kpt, ...2 more

View full report↗︎

Copy link

socket-security bot commented Mar 17, 2025

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Native code pypi/[email protected] ⚠︎
Native code pypi/[email protected] ⚠︎
License Policy Violation pypi/[email protected]
  • License: AFL-1.1 (wandb-0.19.8/core/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt)
⚠︎
Native code pypi/[email protected] ⚠︎

View full report↗︎

Next steps

Why is native code a concern?

Contains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.

Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

What is a license policy violation?

This package is not allowed per your license policy. Review the package's license to ensure compliance.

Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link

cloudflare-workers-and-pages bot commented Mar 17, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff83f15
Status: ✅  Deploy successful!
Preview URL: https://2925e4d9.docodile.pages.dev
Branch Preview URL: https://blue-hawk-demo.docodile.pages.dev

View logs

@@ -13,7 +13,7 @@ jobs:
- name: Find Python scripts
id: list-scripts
run: |
SCRIPTS=$(find scripts -name "*.py" | jq -R -s -c 'split("\n")[:-1]')
SCRIPTS=$(find code_examples/source -name "*.py" | jq -R -s -c 'split("\n")[:-1]')
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit greedy. At a minimum I'd add -type f so you don't find directories that end in .py. I'm also confused why you have to take something that is going to be multi-line input with one result per line, join it up, and then split it again right away?

Suggested change
SCRIPTS=$(find code_examples/source -name "*.py" | jq -R -s -c 'split("\n")[:-1]')
SCRIPTS=$(find 'code_examples/source' -type f -name "*.py" | jq -R -s -c 'split("\n")[:-1]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO-NOT-MERGE For PRs that should not be merged yet WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants