Skip to content

Conversation

mart-r
Copy link
Collaborator

@mart-r mart-r commented Aug 29, 2025

This PR adds only the ES parts from working_with_cogstack.
This is based on the newer cogstack2.py and relevant search notebook.

Currently:

  • Move code from WWC
  • Refactor code
  • Add a few simple tests for cogstack.py module
  • Add a test that runs through the notebook
  • Add workflow
  • Real world validation
  • Documentation on usage (i.e download scripts)
  • Documentation on usage alongside the MedCAT-specific parts
  • Integrate into cogstack-jupyter-hub

Comment on lines +17 to +42
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
max-parallel: 4

steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Check types
run: |
python -m mypy --follow-imports=normal *.py
- name: Lint
run: |
ruff check *.py
- name: Test
run: |
pytest tests

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix the issue, add a permissions block specifying the least necessary privileges for the job. In this workflow, the job does not push changes, create issues, comment on pull requests, or modify repository content—it only checks out code and runs tests/linting. Therefore, limiting permissions to contents: read at the job or workflow root is most appropriate. You can add this block either at the top (outside jobs:) so it applies to all jobs, or directly under the types-lint-tests: job section if you only want to affect that job. The best approach is adding to the root so that future jobs inherit safe defaults.

Edit .github/workflows/cogstack-es_main.yml and insert the block:

permissions:
  contents: read

immediately after the workflow name: and before the on: key.

Suggested changeset 1
.github/workflows/cogstack-es_main.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/cogstack-es_main.yml b/.github/workflows/cogstack-es_main.yml
--- a/.github/workflows/cogstack-es_main.yml
+++ b/.github/workflows/cogstack-es_main.yml
@@ -1,4 +1,6 @@
 name: cogstack-es - Test
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: cogstack-es - Test
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@mart-r mart-r force-pushed the CU-869aa22g2-add-es-from-wwc branch from c4172ee to 329f047 Compare September 23, 2025 14:22
@tomolopolis
Copy link
Member

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.

2 participants