Skip to content

Fix the publishing of the article #1

Closed

Description

@maxime1992

Hi Maeling,

I've seen your comment on dev.to :)
https://dev.to/maelingmurphy/comment/k25j

Can you please upgrade all the dependencies (only dev-to-git needed but good to do them all):

  "dependencies": {
    "dev-to-git": "1.4.1",
    "embedme": "1.19.0",
    "prettier": "1.19.1"
  }

then run yarn to upgrade them + the lock file.

We'll see from there if it works or gives us an error on CI maybe.

Let me know when it's done

Activity

  1. maelingmurphy commented on Jan 15, 2020

    @maelingmurphy
    Owner

    Hi Maxime,

    Thanks so much for taking a look at this for me. I'm completely new to this and just started learning how to use git and Github. I see the dev-to-git.json and .prettierrc files in the folder but I'm not sure how to upgrade these dependencies. Is this something I would do in the command line? If you have a link to a resource that could point me in the right direction, I'd greatly appreciate it!

    Thanks again!

  2. maxime1992 commented on Jan 15, 2020

    @maxime1992
    Author

    Sure no worries. Do you have node and yarn installed on your machine? :)

  3. maelingmurphy commented on Jan 16, 2020

    @maelingmurphy
    Owner
  4. maxime1992 commented on Jan 16, 2020

    @maxime1992
    Author

    Awesome. So, from your terminal go to the root of the project and run:

    yarn upgrade-interactive -E --latest
    

    You'll see the few dependencies of the project that can be updated.
    Use arrow keys to go up and down, press space to select the ones that should be updated (probably all of them).

    Once you're done, press enter.

    Commit the changes files and let me know if that helps 👍

  5. osde8info commented on Jan 16, 2020

    @osde8info

    same problem even with new deps

    "dependencies": {
    "dev-to-git": "1.4.1",
    "embedme": "1.19.0",
    "prettier": "1.19.1"
    }

  6. osde8info commented on Jan 16, 2020

    @osde8info

    does this error help ?

    $ DEV_TO_GIT_TOKEN=DEV_TO_GIT_TOKEN yarn run dev-to-git
    yarn run v1.21.1
    $ dev-to-git
    [DRAFT] Article "Manage your dev.to blog posts from a GIT repo and use continuous deployment to auto publish/update them" encountered an error:
    Error name: "HTTPError"
    Error message: "Response code 401 (Unauthorized)"
    Error stack: "HTTPError: Response code 401 (Unauthorized)
    at EventEmitter.emitter.on (/home/cdarra/git/my-dev-to-pages/node_modules/dev-to-git/bin/dev-to-git.umd.js:7080:23)
    at
    at process._tickCallback (internal/process/next_tick.js:188:7)"
    [DRAFT] Article "Manage your dev.to blog posts from a GIT repo and use continuous deployment to auto publish/update them" encountered an error:
    Error name: "HTTPError"
    Error message: "Response code 401 (Unauthorized)"
    Error stack: "HTTPError: Response code 401 (Unauthorized)
    at EventEmitter.emitter.on (/home/cdarra/git/my-dev-to-pages/node_modules/dev-to-git/bin/dev-to-git.umd.js:7080:23)
    at
    at process._tickCallback (internal/process/next_tick.js:188:7)"
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

  7. osde8info commented on Jan 16, 2020

    @osde8info

    what does this error mean ? "Response code 422 (Unprocessable Entity)"

    $ DEV_TO_GIT_TOKEN=XXXXXXXXXXXXXXXX yarn run dev-to-git
    yarn run v1.21.1
    $ dev-to-git
    [DRAFT] Article "Manage your dev.to blog posts from a GIT repo and use continuous deployment to auto publish/update them" encountered an error:
    Error name: "HTTPError"
    Error message: "Response code 422 (Unprocessable Entity)"
    Error stack: "HTTPError: Response code 422 (Unprocessable Entity)
    at EventEmitter.emitter.on (/home/cdarra/git/my-dev-to-pages/node_modules/dev-to-git/bin/dev-to-git.umd.js:7080:23)
    at
    at process._tickCallback (internal/process/next_tick.js:188:7)"
    [DRAFT] Article "Manage your dev.to blog posts from a GIT repo and use continuous deployment to auto publish/update them" encountered an error:
    Error name: "HTTPError"
    Error message: "Response code 422 (Unprocessable Entity)"
    Error stack: "HTTPError: Response code 422 (Unprocessable Entity)
    at EventEmitter.emitter.on (/home/cdarra/git/my-dev-to-pages/node_modules/dev-to-git/bin/dev-to-git.umd.js:7080:23)
    at
    at process._tickCallback (internal/process/next_tick.js:188:7)"
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

  8. osde8info commented on Jan 16, 2020

    @osde8info

    thanks now working

    $ yarn run prettier:check
    yarn run v1.21.1
    $ yarn run prettier:base --list-different
    $ yarn run prettier "/*.{js,json,scss,md,ts,html,component.html}" --list-different
    $ prettier '
    /*.{js,json,scss,md,ts,html,component.html}' --list-different
    Done in 3.79s.
    cdarra@vbox-xubu-64:/git/my-dev-to-pages$ DEV_TO_GIT_TOKEN=XXXX run dev-to-git
    yarn run v1.21.1
    $ dev-to-git
    [DRAFT] Article "239000" has been successfully updated
    [DRAFT] Article "239001" has been successfully updated
    Done in 2.82s.
    cdarra@vbox-xubu-64:
    /git/my-dev-to-pages$

  9. maelingmurphy commented on Jan 17, 2020

    @maelingmurphy
    Owner

    Awesome. So, from your terminal go to the root of the project and run:

    yarn upgrade-interactive -E --latest
    

    You'll see the few dependencies of the project that can be updated.
    Use arrow keys to go up and down, press space to select the ones that should be updated (probably all of them).

    Once you're done, press enter.

    Commit the changes files and let me know if that helps 👍

    Hi Maxime,

    Thanks for the clear instructions! I was able to upgrade all dependencies successfully. However, I still don't see updates being made to the draft post on dev.to after committing my file changes. I'm really not sure what I'm missing here. Thanks again for your help!

  10. maxime1992 commented on Jan 19, 2020

    @maxime1992
    Author

    I was able to upgrade all dependencies successfully

    Great! 😃!

    I just took a look at your build:

    image

    It's failing, hence why the article has not been updated. If you click on that red cross, you'll get some details about why it failed:

    image

    But what's prettier:check exactly 🤔 ?

    If you take a look into your package.json:

    https://github.com/maelingmurphy/my-dev.to/blob/master/package.json#L11-L12

    image

    There is that script :)

    It's just checking on CI that all the formatting on your repo is fine 👌 --> Which is apparently not right now.

    So what you've got to do now is:

    • locally run yarn run prettier:write
    • you'll see some files updated, commit all of them to fix the bad formating

    On CI, it should be fine and therefore it will move on the next stage which is the publishing of your article :) (by publishing I just mean pushing on dev.to your article or draft 👍)

    I'm pretty sure it'll be fine from now on, let me know 👍

  11. maelingmurphy commented on Jan 23, 2020

    @maelingmurphy
    Owner

    Hi Maxime,

    Thanks again for pointing out these steps! I was not aware of the status icon for the repository before.

    • I did a local run of yarn run pretier:write

    • I committed and pushed all of the updated files

    • I checked that my latest commits were successful and that the build finished successfully on CI

    • I checked the id and relative path of the article in my dev-to-git.json file

    Yet still no updates to the draft post here: https://dev.to/maelingmurphy/test-post-for-github-mn8-temp-slug-6670523?preview=9cac8f6b7cb237a95dee8510648abd589cf74df05c66e93fd2dff50721ec5387f22a70fe47976f35a2d48ed30517d5a2ed2e8cfd989e2abf6dbfe156

    I noticed that although the build exited with 0 on CI, that there was still an error message here pertaining to the article that I wasn't sure how to interpret:
    Screen Shot 2020-01-23 at 3 21 30 PM

    Do you have any thoughts on next steps?

    Thanks again for the assistance!

  12. maxime1992 commented on Jan 23, 2020

    @maxime1992
    Author

    Hey, thanks for the good description!

    Worry no more: I know where it's coming from and.. It's on me... 😅

    There's an issue on the lib I've built maxime1992/dev-to-git#19 (comment)

    So go to dev.to directly, open your article, type anything there (dummy title, dummy content) and re run the CI. It should be working from there! 😁

  13. maelingmurphy commented on Jan 26, 2020

    @maelingmurphy
    Owner

    Hey Maxime!

    No problem! I'm happy to report success at last!! Thank you so much for walking me through this. This was an incredible learning experience, making me more comfortable with Git and Github for sure. Plus, you introduced me to the concept of continuous integration via Travis CI! So grateful for the experience 😀

  14. maxime1992 commented on Jan 27, 2020

    @maxime1992
    Author

    You're very welcome @maelingmurphy!

    Glad you learnt a few things on the way, keep it up and have fun publishing articles 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions