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: replace Travis CI with GH Actions #60

Closed
wants to merge 12 commits into from

Conversation

psankhe28
Copy link
Contributor

@psankhe28 psankhe28 commented Jun 25, 2024

Description

Added GitHub actions for all drs-filer endpoints.

Fixes # (issue)
#58

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not reduced the existing code coverage
  • I have added docstrings following the Python style guidelines of this project to all new modules, classes, methods and functions are documented with docstrings following; I have updated any previously existing docstrings, if applicable
  • I have updated any sections of the app's documentation that are affected by the proposed changes, if applicable

Summary by Sourcery

This pull request replaces Travis CI with GitHub Actions for continuous integration, including workflows for building and publishing Docker images, linting, and running tests. Additionally, it introduces new tests for DRS-Filer endpoints.

  • New Features:
    • Added GitHub Actions workflows for building, publishing Docker images, linting, and running tests.
  • Enhancements:
    • Replaced Travis CI with GitHub Actions for continuous integration.
  • CI:
    • Introduced a GitHub Actions workflow for building and publishing Docker images on push to the 'dev' branch.
    • Added a GitHub Actions workflow for linting and running unit tests on push and pull requests.
    • Created a GitHub Actions workflow to test DRS-Filer API endpoints using Docker Compose and pytest.
  • Tests:
    • Added comprehensive tests for DRS-Filer endpoints using pytest.

Signed-off-by: Prati28 <[email protected]>
Copy link
Contributor

sourcery-ai bot commented Jun 25, 2024

Reviewer's Guide by Sourcery

This pull request introduces a new GitHub Actions workflow to automate the testing of all DRS-Filer API endpoints. The workflow is triggered on push and pull request events, and includes steps to build and run Docker Compose, install necessary tools, and execute a series of API endpoint tests to ensure the functionality of the DRS-Filer service. Additionally, the Travis CI configuration has been removed in favor of the new GitHub Actions workflows.

File-Level Changes

Files Changes
.github/workflows/docker-build-publish-drs-filer.yml
.github/workflows/lint.yml
.github/workflows/test.yml
Added new GitHub Actions workflows for building and publishing Docker images, linting and running unit tests, and testing DRS-Filer API endpoints. These workflows replace the previous Travis CI configuration.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @psankhe28 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 5 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved

- name: Test POST /service-info
run: |
RESPONSE=$(curl -X POST http://localhost:8080/ga4gh/drs/v1/service-info -H 'Content-Type: application/json' -d '{"contactUrl": "mailto:[email protected]","createdAt": "2024-06-12T12:58:19Z","description": "This service provides...","documentationUrl": "https://docs.myservice.example.com","environment": "test","id": "org.ga4gh.myservice","name": "My project","organization": {"name": "My organization","url": "https://example.com"},"type": {"artifact": "beacon","group": "org.ga4gh","version": "1.0.0"},"updatedAt": "2024-06-12T12:58:19Z","version": "1.0.0"}')
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider breaking down long JSON payloads

The JSON payload in this POST request is quite long and can be hard to read. Consider breaking it down into multiple lines or using a JSON file to improve readability.

psankhe28 and others added 3 commits June 25, 2024 13:33
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: Prati28 <[email protected]>
@psankhe28 psankhe28 requested a review from uniqueg June 25, 2024 08:08
@uniqueg uniqueg changed the title feat: add github actions ci: replace Travis CI with GH Actions Jul 1, 2024
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
@psankhe28 psankhe28 requested a review from uniqueg July 3, 2024 11:35
@psankhe28 psankhe28 marked this pull request as draft July 3, 2024 13:08
.github/workflows/lint.yml Outdated Show resolved Hide resolved
@psankhe28 psankhe28 marked this pull request as ready for review July 3, 2024 14:34
Copy link
Member

@uniqueg uniqueg left a comment

Choose a reason for hiding this comment

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

This looks good - thanks a lot. However, we should test whether these workflows actually do what they are supposed to do - without having to merge them first.

For that, you need to ensure that there are no conditions that stop the workflows from running, like:

  • restrictions on the conditions under which workflows are triggered
  • creating the PR from a feature branch and not a fork (which imposes restrictions on the use of secrets)

@uniqueg
Copy link
Member

uniqueg commented Jul 22, 2024

Also, please address the Sourcery AI comments - they make a lot of sense 🙏

@psankhe28
Copy link
Contributor Author

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @psankhe28 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding some high-level comments in the test.py file to explain the purpose of each test function and any complex logic.
  • The Python versions in the linting workflow (3.6, 3.7, 3.8) are quite old. Consider updating to more recent versions for better support and features.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟡 Security: 1 issue found
  • 🟡 Testing: 13 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
@uniqueg
Copy link
Member

uniqueg commented Jul 22, 2024

Couple more good Sourcery comments :)

@psankhe28 psankhe28 closed this Jul 22, 2024
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