You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by uce <gi...@git.apache.org> on 2017/02/16 11:02:17 UTC

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

GitHub user uce opened a pull request:

    https://github.com/apache/flink/pull/3332

    [FLINK-5751] [docs] Add link check script

    This is a slightly adjusted script from @patricklucas as posted in FLINK-5751.
    
    I was wondering whether it makes sense to have it inside the repo, the local work flow would be:
    ```sh
    ./build_docs.sh -p
    ./check_links.sh
    ```
    
    You can overwrite the URL to check like `./check_links.sh https://ci.apache.org/projects/flink/flink-docs-master/`.
    
    @rmetzger @patricklucas Should we include this?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uce/flink check_links

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3332.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3332
    
----
commit 50a879d8d18d009787fb6c67d78e0e5b79e010a9
Author: Ufuk Celebi <uc...@apache.org>
Date:   2017-02-16T10:58:35Z

    [FLINK-5751] [docs] Add link check script

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3332#discussion_r101786279
  
    --- Diff: docs/check_links.sh ---
    @@ -0,0 +1,36 @@
    +#!/usr/bin/env bash
    +################################################################################
    +#  Licensed to the Apache Software Foundation (ASF) under one
    +#  or more contributor license agreements.  See the NOTICE file
    +#  distributed with this work for additional information
    +#  regarding copyright ownership.  The ASF licenses this file
    +#  to you under the Apache License, Version 2.0 (the
    +#  "License"); you may not use this file except in compliance
    +#  with the License.  You may obtain a copy of the License at
    +#
    +#      http://www.apache.org/licenses/LICENSE-2.0
    +#
    +#  Unless required by applicable law or agreed to in writing, software
    +#  distributed under the License is distributed on an "AS IS" BASIS,
    +#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +#  See the License for the specific language governing permissions and
    +# limitations under the License.
    +################################################################################
    +
    +target=${1:-"http://localhost:4000"}
    +
    +# Crawl the docs, ignoring robots.txt, storing nothing locally
    +wget --spider -r -nd -nv -e robots=off -p -o spider.log "$target"
    +
    +# Abort for anything other than 0 and 4 ("Network failure")
    +status=$?
    +if [ $status -ne 0 ] && [ $status -ne 4 ]; then
    +    exit $status
    +fi
    +
    +# Fail the build if any broken links are found
    +broken_links_str=$(grep -e 'Found [[:digit:]]\+ broken link(s)' spider.log)
    +if [ -n "$broken_links_str" ]; then
    +	echo -e "\e[1;31m$broken_links_str\e[0m"
    --- End diff --
    
    Mixed tabs/spaces in this file if you want to do a no-review follow-up commit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

Posted by uce <gi...@git.apache.org>.
Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3332#discussion_r101801834
  
    --- Diff: docs/check_links.sh ---
    @@ -0,0 +1,36 @@
    +#!/usr/bin/env bash
    +################################################################################
    +#  Licensed to the Apache Software Foundation (ASF) under one
    +#  or more contributor license agreements.  See the NOTICE file
    +#  distributed with this work for additional information
    +#  regarding copyright ownership.  The ASF licenses this file
    +#  to you under the Apache License, Version 2.0 (the
    +#  "License"); you may not use this file except in compliance
    +#  with the License.  You may obtain a copy of the License at
    +#
    +#      http://www.apache.org/licenses/LICENSE-2.0
    +#
    +#  Unless required by applicable law or agreed to in writing, software
    +#  distributed under the License is distributed on an "AS IS" BASIS,
    +#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +#  See the License for the specific language governing permissions and
    +# limitations under the License.
    +################################################################################
    +
    +target=${1:-"http://localhost:4000"}
    +
    +# Crawl the docs, ignoring robots.txt, storing nothing locally
    +wget --spider -r -nd -nv -e robots=off -p -o spider.log "$target"
    +
    +# Abort for anything other than 0 and 4 ("Network failure")
    +status=$?
    +if [ $status -ne 0 ] && [ $status -ne 4 ]; then
    +    exit $status
    +fi
    +
    +# Fail the build if any broken links are found
    +broken_links_str=$(grep -e 'Found [[:digit:]]\+ broken link(s)' spider.log)
    +if [ -n "$broken_links_str" ]; then
    +	echo -e "\e[1;31m$broken_links_str\e[0m"
    --- End diff --
    
    Thanks for catching this! Fixed in a separate commit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3332#discussion_r101678631
  
    --- Diff: docs/check_links.sh ---
    @@ -0,0 +1,39 @@
    +#!/usr/bin/env bash
    +################################################################################
    +#  Licensed to the Apache Software Foundation (ASF) under one
    +#  or more contributor license agreements.  See the NOTICE file
    +#  distributed with this work for additional information
    +#  regarding copyright ownership.  The ASF licenses this file
    +#  to you under the Apache License, Version 2.0 (the
    +#  "License"); you may not use this file except in compliance
    +#  with the License.  You may obtain a copy of the License at
    +#
    +#      http://www.apache.org/licenses/LICENSE-2.0
    +#
    +#  Unless required by applicable law or agreed to in writing, software
    +#  distributed under the License is distributed on an "AS IS" BASIS,
    +#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +#  See the License for the specific language governing permissions and
    +# limitations under the License.
    +################################################################################
    +
    +# Don't abort on any non-zero exit code
    +#set +e
    +
    +target=${1:-"http://localhost:4000"}
    +
    +# Crawl the docs, ignoring robots.txt, storing nothing locally
    +wget --spider -r -nd -nv -e robots=off -p -o spider.log $target
    +
    +# Abort for anything other than 0 and 4 ("Network failure")
    +status=$?
    +if [ $status -ne 0 ] && [ $status -ne 4 ]; then
    +    exit $status
    +fi
    +
    +# Fail the build if any broken links are found
    +broken_links_str=$(grep -e 'Found [[:digit:]]\+ broken link' spider.log)
    +echo -e "$broken_links_str"
    --- End diff --
    
    If you're going to get rid of my pretty bold-red formatting you can drop the `-e` too. :)
    
    Actually, might as well put the `echo` line inside the `if` too.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3332#discussion_r101678241
  
    --- Diff: docs/check_links.sh ---
    @@ -0,0 +1,39 @@
    +#!/usr/bin/env bash
    +################################################################################
    +#  Licensed to the Apache Software Foundation (ASF) under one
    +#  or more contributor license agreements.  See the NOTICE file
    +#  distributed with this work for additional information
    +#  regarding copyright ownership.  The ASF licenses this file
    +#  to you under the Apache License, Version 2.0 (the
    +#  "License"); you may not use this file except in compliance
    +#  with the License.  You may obtain a copy of the License at
    +#
    +#      http://www.apache.org/licenses/LICENSE-2.0
    +#
    +#  Unless required by applicable law or agreed to in writing, software
    +#  distributed under the License is distributed on an "AS IS" BASIS,
    +#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +#  See the License for the specific language governing permissions and
    +# limitations under the License.
    +################################################################################
    +
    +# Don't abort on any non-zero exit code
    +#set +e
    +
    +target=${1:-"http://localhost:4000"}
    +
    +# Crawl the docs, ignoring robots.txt, storing nothing locally
    +wget --spider -r -nd -nv -e robots=off -p -o spider.log $target
    --- End diff --
    
    $target in quotes


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/3332


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3332: [FLINK-5751] [docs] Add link check script

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3332#discussion_r101678217
  
    --- Diff: docs/check_links.sh ---
    @@ -0,0 +1,39 @@
    +#!/usr/bin/env bash
    +################################################################################
    +#  Licensed to the Apache Software Foundation (ASF) under one
    +#  or more contributor license agreements.  See the NOTICE file
    +#  distributed with this work for additional information
    +#  regarding copyright ownership.  The ASF licenses this file
    +#  to you under the Apache License, Version 2.0 (the
    +#  "License"); you may not use this file except in compliance
    +#  with the License.  You may obtain a copy of the License at
    +#
    +#      http://www.apache.org/licenses/LICENSE-2.0
    +#
    +#  Unless required by applicable law or agreed to in writing, software
    +#  distributed under the License is distributed on an "AS IS" BASIS,
    +#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +#  See the License for the specific language governing permissions and
    +# limitations under the License.
    +################################################################################
    +
    +# Don't abort on any non-zero exit code
    +#set +e
    --- End diff --
    
    This is a vestige from me writing this as a Jenkins jobs; you can remove this line and the above comment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3332: [FLINK-5751] [docs] Add link check script

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the issue:

    https://github.com/apache/flink/pull/3332
  
    Thanks @patricklucas, I've addressed your comments and re-added the red formatting, which is nice indeed. ;-) I'm going to merge this with you as the author. Hope that's fine. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3332: [FLINK-5751] [docs] Add link check script

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on the issue:

    https://github.com/apache/flink/pull/3332
  
    :+1:


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---