Skip to content

Conversation

@nxtcoder17
Copy link
Owner

@nxtcoder17 nxtcoder17 commented Oct 20, 2024

Closes #19

Summary by Sourcery

Bug Fixes:

  • Fix global dotenv paths to resolve absolute path errors by adjusting the path resolution logic.

- updates examples to accomodate the changes

gh-issue: #19
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 20, 2024

Reviewer's Guide by Sourcery

This pull request fixes an issue with global dot-env paths that were failing due to absolute path errors. The changes involve modifying the Runfile configuration and updating the task parser to handle relative paths correctly.

Class diagram for updated task parser

classDiagram
    class Runfile {
        +List~String~ DotEnv
    }
    class TaskParser {
        +ParseTask(Context, Runfile, Task) ParsedTask, Error
    }
    class Context
    class ParsedTask
    class Error
    class FilePath {
        +resolveDotEnvFiles(String, List~String~) List~String~, Error
    }
    Runfile --> TaskParser : uses
    TaskParser --> ParsedTask
    TaskParser --> Error
    TaskParser --> FilePath : uses
    FilePath --> Error
Loading

File-Level Changes

Change Details Files
Move dotenv configuration to the global level
  • Add a global 'dotenv' configuration
  • Comment out the task-specific 'dotenv' configuration
examples/Runfile.yml
Update task parser to resolve dotenv file paths
  • Add a new function call to resolve dotenv file paths
  • Use resolved paths when parsing dotenv files
pkg/runfile/task-parser.go
Modify example task to demonstrate dotenv usage
  • Add a command to echo the value of 'key_id' from the dotenv file
  • Remove commented-out commands
examples/Runfile.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#19 Fix the issue with runfile failing when using global dotenv
#19 Resolve absolute path errors related to dotenv files

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@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 @nxtcoder17 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 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 and I'll use the feedback to improve your reviews.

@nxtcoder17 nxtcoder17 merged commit db127b0 into master Oct 20, 2024
@nxtcoder17 nxtcoder17 deleted the bug/absolute-dotenv-paths-on-global-dotenv branch October 20, 2024 04:58
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.

[🐛 BUG] runfile with global dotenv, fails

2 participants