maelingmurphy / my-dev.to

My dev.to blog posts
1 stars 1 forks source link

Fix the publishing of the article #1

Closed maxime1992 closed 4 years ago

maxime1992 commented 4 years ago

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

maelingmurphy commented 4 years ago

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!

maxime1992 commented 4 years ago

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

maelingmurphy commented 4 years ago

Thanks so much! Yes, I do remember installing node and yarn via the terminal.

On Wed, Jan 15, 2020, 4:49 AM Maxime notifications@github.com wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maelingmurphy/my-dev.to/issues/1?email_source=notifications&email_token=ADKR4LDOX5V7S6FY6CAVKPDQ53L3DA5CNFSM4KFY2TZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI7WRWI#issuecomment-574580953, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKR4LDBEJKGNS32MRJVTZDQ53L3DANCNFSM4KFY2TZQ .

maxime1992 commented 4 years ago

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 :+1:

osde8info commented 4 years ago

same problem even with new deps

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

osde8info commented 4 years ago

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.

osde8info commented 4 years ago

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.

osde8info commented 4 years ago

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$

maelingmurphy commented 4 years ago

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!

maelingmurphy commented 4 years ago

This is the draft post I have linked via the id # in the dev-to-git.json file

https://dev.to/maelingmurphy/test-post-for-github-mn8-temp-slug-6670523?preview=9cac8f6b7cb237a95dee8510648abd589cf74df05c66e93fd2dff50721ec5387f22a70fe47976f35a2d48ed30517d5a2ed2e8cfd989e2abf6dbfe156

maxime1992 commented 4 years ago

I was able to upgrade all dependencies successfully

Great! :smiley:!

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 :thinking: ?

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 :ok_hand: --> Which is apparently not right now.

So what you've got to do now is:

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 :+1:)

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

maelingmurphy commented 4 years ago

Hi Maxime,

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

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!

maxime1992 commented 4 years ago

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 https://github.com/maxime1992/dev-to-git/issues/19#issuecomment-577413138

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! 😁

maelingmurphy commented 4 years ago

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 😀

maxime1992 commented 4 years ago

You're very welcome @maelingmurphy!

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