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

fix: logs: deploy command instructs user to link to a site if one is … #6867

Merged
merged 9 commits into from
Oct 18, 2024

Conversation

benhancock
Copy link
Contributor

…not linked

🎉 Thanks for submitting a pull request! 🎉

Summary

Previously, when running netlify logs:deploy while not linked to a site, CLI would throw nondescriptive › Error: Missing required path variable 'site_id' error. This fix introduces a new message when a user attempts to run netlify logs:deploy without a linked site: You must link a site before attempting to view deploy logs.

Fixes issue from Internal issue system

- When attempting to use the CLI to view deployment logs, an error is displayed about missing a site_id. The error is misleading as the actual issue is caused by attempting to run the command in a non-linked repo.
    
    ### Reproduction Steps
    
    1. Clone (or create) a repository for a site deployed to Netlify
    2. **DO NOT** link the local repo to the netlify deploy
        1. ex: working in a repo across two computers (or setting site up for automatic github deploys w/o explicitly linking the directory locally)
        2. linking and deploying via CLI on one machine is OK, but attempting to use the CLI on the other machine that hasn’t been explicitly linked will exhibit the issue
    3. Attempt to run `netlify logs:deploy --debug`
    4. Notice you receive the following error: `Error: Missing required path variable 'site_id'`
    5. Link the repo to a netlify site via `netlify link`
    6. Re-run `netlify logs:deploy --debug`
    7. Notice the logs display as expected.
    
    https://uploads.linear.app/2035771a-8004-45ae-ade6-a07496931d25/0f110587-99cb-410f-a579-d21852cf2334/4185ba6f-3190-4f19-9f30-4152f5a6a3ac
    
    Might not be relevant, but it fails in a slightly different manner if you don’t format the debug flag correctly:
    
    ```
    $ ntl logs:deploy debug
     ›   Error: Missing required path variable 'site_id'
    ```
    
    https://uploads.linear.app/2035771a-8004-45ae-ade6-a07496931d25/0c10007e-b8df-4cb8-89da-a3f9d8c26e7b/cedd7900-356e-4a16-821d-40843e6a5bb6

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@benhancock benhancock requested a review from a team as a code owner October 9, 2024 17:05
@benhancock
Copy link
Contributor Author

@DanielSLew The two failing CI tests don't seem to give us specific enough information to know what to fix. It seems like the failures might be related to the CI setup itself and not our code? What are your thoughts?

@DanielSLew
Copy link
Contributor

@benhancock This seems to be a bigger issue. Vale is failing on a few of our repos so we've removed the "required" check for it for now until it is fixed so we can still merge PRs, so consider this not blocking

@DanielSLew DanielSLew enabled auto-merge (squash) October 18, 2024 16:59
@DanielSLew DanielSLew merged commit 98763f7 into netlify:main Oct 18, 2024
47 checks passed
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