Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fixed issue #12745 #12781

Closed
wants to merge 5 commits into from
Closed

Fixed issue #12745 #12781

wants to merge 5 commits into from

Conversation

LuckyPigeon
Copy link
Contributor

Description

Filter prompt sign while copying code from the website. Fixed #12745

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@sandeep-krishnamurthy sandeep-krishnamurthy added Doc pr-awaiting-review PR is waiting for code review labels Oct 10, 2018
Copy link
Contributor

@sandeep-krishnamurthy sandeep-krishnamurthy left a comment

Choose a reason for hiding this comment

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

LGTM.
Build failed for unrelated issue. Restarted it. We should check on build docs site to verify before merging.

@aaronmarkham - Can you please take a look? Thanks.

@vishaalkapoor
Copy link
Contributor

LGTM!

@aaronmarkham
Copy link
Contributor

I checked http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-12781/2/tutorials/gluon/mnist.html
And I found that the first code block will still copy the $.

lines[i] = lines[i].replace(re, "");
break;
}
}
lines[i] = lines[i].replace(/^\s+|\s+$/g, "");
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you didn't change this line, but it seems to be throwing errors in the preview.

Uncaught ReferenceError: g is not defined
    at copycode.js:67
    at t.emit (clipboard.min.js:7)
    at e (clipboard.min.js:7)
    at e (clipboard.min.js:7)
    at e (clipboard.min.js:7)
    at e (clipboard.min.js:7)
    at new e (clipboard.min.js:7)
    at t.e (clipboard.min.js:7)
    at HTMLBodyElement.<anonymous> (clipboard.min.js:7)
    at HTMLBodyElement.<anonymous> (clipboard.min.js:7)

There's also some 403 errors happening which really are 404's. Seems like there might be a bigger issue going on here...

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, it is a line in the updated code block... line 67...

var re = new RegExp(LANG_GP[lang], g);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@aaronmarkham
Copy link
Contributor

Looks like we're hung up on a flaky test. I opened an issue here: #12797
I'll retrigger CI, but it might just fail again until that test is disabled.

@aaronmarkham
Copy link
Contributor

Now tracking #12788 - might need to rebase after this PR gets merged.

@LuckyPigeon
Copy link
Contributor Author

@aaronmarkham I find that #12788 has closed, but I can't find the new PR issue related with it. Does the changes are already Updated?

@sandeep-krishnamurthy
Copy link
Contributor

@LuckyPigeon - The regression is reverted and master is Green now. Can you please rebase your branch once?

@aaronmarkham
Copy link
Contributor

@LuckyPigeon Let me know if you need any help.

@LuckyPigeon
Copy link
Contributor Author

LuckyPigeon commented Oct 20, 2018

@aalexandrov This is my first time using git rebase, this shows up after I rebase.

First, rewinding head to replay your work on top of it...
Applying: Fixed issue 12745
Applying: Fix copycode.js error caused by new code block

Is this means rebase successfully?
Did I need to push after I rebase?

@aaronmarkham
Copy link
Contributor

@aalexandrov This is my first time using git rebase, this shows up after I rebase.

First, rewinding head to replay your work on top of it...
Applying: Fixed issue 12745
Applying: Fix copycode.js error caused by new code block

Is this means rebase successfully?
Did I need to push after I rebase?

It looks like it worked, but I think you still need to git push now. We should see another commit, and that commit will trigger CI.

@LuckyPigeon
Copy link
Contributor Author

LuckyPigeon commented Oct 23, 2018

I encounter a problem while I using git push
image
I have already using git pull and is already up to date, but still show up the same error.

@aaronmarkham
Copy link
Contributor

Take a look at https://cwiki.apache.org/confluence/display/MXNET/MXNet+Development+Guide

The section that talks about making a PR has this as a guide:

git remote add upstream https://github.com/apache/incubator-mxnet
git fetch upstream
git rebase upstream/master

After going through the rebase process, you might have to force push with:

git push --force

@LuckyPigeon
Copy link
Contributor Author

@aaronmarkham After I go through those commands, I encounter this error.
image

@aaronmarkham
Copy link
Contributor

You can't push upstream.
Just do 'git push --force'
That will force push to your fork and it will automatically update your pull request.

@LuckyPigeon
Copy link
Contributor Author

LuckyPigeon commented Oct 25, 2018

@aaronmarkham It's seems I can't do git push --force, after I do the command and it shows this message.
image

@aaronmarkham
Copy link
Contributor

aaronmarkham commented Oct 29, 2018

Maybe try the suggested command and then force? I'm not sure how you're setup. If you'd like we can get on slack and troubleshoot in realtime. I'm in California. Let me know a time that works for you (I'm typically available 845am - 615pm).

@aaronmarkham
Copy link
Contributor

@LuckyPigeon
Copy link
Contributor Author

@aaronmarkham I still don't get it. Why the install page still copying the bash prompt. I have test it functionally on my local machine, but when I put it on the web, it couldn't work anymore.

@kalyc
Copy link
Contributor

kalyc commented Nov 13, 2018

@aaronmarkham could you please elaborate more here?

@stu1130
Copy link
Contributor

stu1130 commented Nov 21, 2018

@aaronmarkham ping again

@aaronmarkham
Copy link
Contributor

There are about a half dozen document.ready functions that trigger, so this could be an issue with the js.
The fact that it is broken in the CI preview means that you can emulate it locally when you build the docs (running make html from the docs folder).

I was able to see the issue on another page, so it isn't limited to the install page:
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-12781/6/tutorials/gluon/mnist.html

@LuckyPigeon can you see that it isn't working on the above link? Can you debug it from there to see why your change isn't working?

@vandanavk
Copy link
Contributor

vandanavk commented Nov 27, 2018

@mxnet-label-bot update [pr-awaiting-response, Doc]

@marcoabreu marcoabreu removed Doc pr-awaiting-review PR is waiting for code review labels Nov 27, 2018
@LuckyPigeon
Copy link
Contributor Author

@sandeep-krishnamurthy Recently, I have started my vacation, and I can continue this PR again.

@sandeep-krishnamurthy
Copy link
Contributor

@LuckyPigeon - When you update, please let me know, we can take this to completion.

@LuckyPigeon
Copy link
Contributor Author

@sandeep-krishnamurthy Updated!

Copy link
Contributor

@aaronmarkham aaronmarkham left a comment

Choose a reason for hiding this comment

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

In the preview here: http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-12781/3/tutorials/gluon/mnist.html
The $ is still copied: $ pip install requests jupyter

@LuckyPigeon
Copy link
Contributor Author

@aaronmarkham Does the preview link build successfully? Because I build the code locally and shows the right result.
Here's my local doc build:
screenshot from 2019-02-10 10-42-23

@aaronmarkham
Copy link
Contributor

No, the preview link I gave in my last comment shows that it isn't working. The $ is still copied.

@LuckyPigeon
Copy link
Contributor Author

LuckyPigeon commented Feb 20, 2019

@aaronmarkham I'm not sure what went wrong while building docs. I've tried built the code of this pull request on ubuntu 1804 and the $ sign can be removed successfully. So that must be some other thing went wrong while building the docs. Can you recommend some people for help solving the problem? Thanks!

@aaronmarkham
Copy link
Contributor

Can you share a preview link to where you have it working? Maybe I can see what's different.

@LuckyPigeon
Copy link
Contributor Author

But I build it on my local machine, so I don't have a preview link. I can only share the _build folder after I built the docs successfully.

@anirudhacharya
Copy link
Member

@LuckyPigeon @aaronmarkham please revisit this PR and see it to completion.

@karan6181
Copy link
Contributor

@LuckyPigeon Can you please address the review comments?

@aaronmarkham Could you please review this PR again?

Thank you!

@LuckyPigeon
Copy link
Contributor Author

@karan6181 Sure, but I not quite understand what went wrong in the code. Because the amazon machine can't filter the prompt with the code, but when I build the docs on the local machine success.

@piyushghai
Copy link
Contributor

@LuckyPigeon Were you able to figure out the issue blocking this PR ?

@Roshrini
Copy link
Member

Thanks for working on this. This will be useful for uers. @aaronmarkham Can you help @LuckyPigeon by any chance?

@aaronmarkham
Copy link
Contributor

The preview link doesn't work anymore. I'm not convinced this is fixed. Seems like a larger issue, really.

@roywei
Copy link
Member

roywei commented Apr 30, 2019

@LuckyPigeon Thanks for the contribution, could you address the comments?

1 similar comment
@pinaraws
Copy link

@LuckyPigeon Thanks for the contribution, could you address the comments?

@LuckyPigeon
Copy link
Contributor Author

@roywei @pinaraws Sure. But the problem seems has nothing to do with the code of copycode.js , I think it's something wrong while building the docs, I have encounter it recently, but I am still not sure which part goes wrong.

@piyushghai
Copy link
Contributor

@LuckyPigeon @aaronmarkham What's the path forward on this PR ?

@Roshrini
Copy link
Member

@aaronmarkham Is there any issue with docs build as @LuckyPigeon Mentioned?

@aaronmarkham
Copy link
Contributor

It is known that the website publish process (including python module beautiful soup doing code injections, along with some of the site's javascript, cause or have bugs. These make the DOM and interactions therewith unpredictable. The full production build to recreate such issues is bulky, difficult, as well as resource and time consuming. I fear that without front-end engineering help and resources (access to sufficient build/server allocations) @LuckyPigeon is going to be forever stuck on this PR. I have looked at the issue, and I see it as a rabbit hole of javascript and publishing bugs that need to be fixed.

@karan6181
Copy link
Contributor

@LuckyPigeon Ping for the update? How should we drive this PR to resolution? Thanks!

@@ -1,3 +1,4 @@
/*Copy code to clipboard*/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/*Copy code to clipboard*/

@piyushghai
Copy link
Contributor

@LuckyPigeon Gentle ping for drive this PR forward.

@LuckyPigeon
Copy link
Contributor Author

@Roshrini @aaronmarkham @karan6181 @piyushghai
Sorry for late reply. I have followed the mxnet doc build instruction and build a doc on my local computer before, and sometimes it will encounter a problem that after I update my code and execute $ make html, it can't detect the update, and after executed the command, index.html stays the same as before.
Like @aaronmarkham said before, I think I am going to need front-end engineering help, who develop the mxnet docs for the best, and I am going to trace the doc code and find out where the problem is.

@aaronmarkham
Copy link
Contributor

Hi @LuckyPigeon thanks for following up on this. I wouldn't spend any more time on this issue. We're looking at swapping out all of the javascript and front-end so I don't think we'll have this issue any more... or at least maybe this feature can be added safely to the new site.

If you want to check it out, we have a PR here:
#15884

@aaronmarkham
Copy link
Contributor

Closing since the new site doesn't have this function/issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Doc pr-awaiting-response PR is reviewed and waiting for contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying code from the website also copies the prompts