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

Integrate emilio #1944

Merged
merged 1 commit into from
Apr 15, 2020
Merged

Integrate emilio #1944

merged 1 commit into from
Apr 15, 2020

Conversation

iilyak
Copy link
Contributor

@iilyak iilyak commented Feb 26, 2019

Overview

Add emilio erlang linter to ensure unified style.

Testing recommendations

  • do a fresh clone and run ./configure (make sure bin/emilio script is created)
  • run ./configure again and make sure it doesn't try to install emilio again
  • Update any erlang files in any dependency (except files mentioned in ignore section of emilio.config)
  • Run make emilio and make sure that:
    • produced warnings are only for (± 3) updated lines
    • make fails with non 0 exit code
  • Run bin/emilio -c emilio.config src | bin/warnings_in_scope -s 0 to see warnings from emilio
    • make sure produced warnings are only for updated lines
  • Run bin/emilio -c emilio.config src and make sure dependencies mentioned in ignore section of emilio.config are ignored
  • test it on windows if you have access to it (I don't have access to windows :-()

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

configure Show resolved Hide resolved
@wohali
Copy link
Member

wohali commented Feb 26, 2019

Interesting, will look at this in more detail later

@iilyak
Copy link
Contributor Author

iilyak commented Jan 17, 2020

@wohali I know you are busy with 3.0. Should I rebase against latest master or wait couple months (the release process is exhausting I am sure)?

@wohali
Copy link
Member

wohali commented Jan 17, 2020

Hey @iilyak , it was @davisp who was initially against this. If you can get his +1, I'd love to see it in 3.0, go ahead and rebase.

Copy link
Member

@wohali wohali left a comment

Choose a reason for hiding this comment

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

Needs a bit more Windows love.

Makefile.win Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@@ -217,12 +217,25 @@ install_local_rebar() {
fi
}

install_local_emilio() {
Copy link
Member

Choose a reason for hiding this comment

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

You need to add all of this to configure.ps1 too. Are you up to the challenge? 🥊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a challenge indeed.

Copy link
Member

@wohali wohali Apr 2, 2020

Choose a reason for hiding this comment

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

Here's the diff, feel free to add to this PR:

diff --git a/configure.ps1 b/configure.ps1
index c74fbcf41..21c079f67 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -205,6 +205,20 @@ if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null)
    $env:Path += ";$rootdir\bin"
 }

+# check for emilio; if not found, get it and build it
+if ((Get-Command "emilio.cmd" -ErrorAction SilentlyContinue) -eq $null)
+{
+   Write-Verbose "==> emilio.cmd not found; bootstrapping..."
+   if (-Not (Test-Path "src\emilio"))
+   {
+      git clone --depth 1 https://github.com/wohali/emilio $rootdir\src\emilio
+   }
+   cmd /c "cd $rootdir\src\emilio && rebar compile escriptize"
+   cp $rootdir\src\emilio\emilio $rootdir\bin\emilio
+   cp $rootdir\src\emilio\bin\emilio.cmd $rootdir\bin\emilio.cmd
+   cmd /c "cd $rootdir\src\emilio && rebar clean"
+}
+
 # only update dependencies, when we are not in a release tarball
 if ( (Test-Path .git -PathType Container) -and (-not $SkipDeps) ) {
     Write-Verbose "==> updating dependencies"

Note this depends on cloudant-labs/emilio#3 being merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much.

@garrensmith
Copy link
Member

I'm digging this up again. Could we look at adding this into the CI flow without adding support for windows? Its going to be hard to do that.

@wohali
Copy link
Member

wohali commented Apr 2, 2020

@garrensmith If you or @iilyak can freshen this PR to not have a conflict on Makefile, I'll have a look at configure.ps1.

@wohali
Copy link
Member

wohali commented Apr 2, 2020

Also, if you can move the source branch into the apache/couchdb repo, I can PR against it with the Windows changes. Otherwise, I'll just post a diff here that you can apply yourself.

@garrensmith
Copy link
Member

garrensmith commented Apr 2, 2020 via email

cwd=`pwd`
cd ${rootdir}/src/emilio && ${REBAR} compile escriptize; cd ${cwd}
mv ${rootdir}/src/emilio/emilio ${rootdir}/bin/emilio
chmod +x ${rootdir}/bin/emilio
Copy link
Member

Choose a reason for hiding this comment

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

Should also do a cd ${rootdir}/src/emilio && ${REBAR} clean at this point, like we do on L216 for rebar.

Copy link
Member

@wohali wohali left a comment

Choose a reason for hiding this comment

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

Pre-approved, once requested changes / linked PR are applied.

FYI: As emilio is an optional testing component, and we don't ship the code, it does not need to live in an Apache repo.

@@ -217,12 +217,25 @@ install_local_rebar() {
fi
}

install_local_emilio() {
Copy link
Member

@wohali wohali Apr 2, 2020

Choose a reason for hiding this comment

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

Here's the diff, feel free to add to this PR:

diff --git a/configure.ps1 b/configure.ps1
index c74fbcf41..21c079f67 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -205,6 +205,20 @@ if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null)
    $env:Path += ";$rootdir\bin"
 }

+# check for emilio; if not found, get it and build it
+if ((Get-Command "emilio.cmd" -ErrorAction SilentlyContinue) -eq $null)
+{
+   Write-Verbose "==> emilio.cmd not found; bootstrapping..."
+   if (-Not (Test-Path "src\emilio"))
+   {
+      git clone --depth 1 https://github.com/wohali/emilio $rootdir\src\emilio
+   }
+   cmd /c "cd $rootdir\src\emilio && rebar compile escriptize"
+   cp $rootdir\src\emilio\emilio $rootdir\bin\emilio
+   cp $rootdir\src\emilio\bin\emilio.cmd $rootdir\bin\emilio.cmd
+   cmd /c "cd $rootdir\src\emilio && rebar clean"
+}
+
 # only update dependencies, when we are not in a release tarball
 if ( (Test-Path .git -PathType Container) -and (-not $SkipDeps) ) {
     Write-Verbose "==> updating dependencies"

Note this depends on cloudant-labs/emilio#3 being merged.

@davisp
Copy link
Member

davisp commented Apr 2, 2020

@wohali cloudant-labs/emilio#3 is merged.

@iilyak iilyak force-pushed the integrate-emilio branch 2 times, most recently from 9cfc5e7 to fbf4710 Compare April 3, 2020 11:39
@iilyak
Copy link
Contributor Author

iilyak commented Apr 3, 2020

CI is failing with unrelated issue 😢

[2020-04-03T11:40:38.315Z] ==> couch_replicator (compile)

[2020-04-03T11:40:38.662Z] /home/****/workspace/****-cm1_PullRequests_PR-1944/src/couch_replicator/src/couch_replicator_httpc.erl:16: can't find include lib "ibrowse/include/ibrowse.hrl"

@wohali
Copy link
Member

wohali commented Apr 3, 2020

@iilyak

I also can't build your branch, either in the CI environment or locally. Here's what I'm doing:

rm -rf couchdb
git clone https://github.com/cloudant/couchdb
cd couchdb
git checkout integrate-emilio
./configure --with-curl
make dist

This fails in the same way as Jenkins is failing.

I don't get the same failure from apache/couchdb:master.

Also you still need to apply the diff I provided in comment.

Perhaps close this PR and reopen it by doing the branch off of apache/couchdb instead of cloudant/couchdb? Maybe it's because cloudant/couchdb:master is ~1400 commits behind, I don't know. @rnewson might have a better idea.

@jaydoane
Copy link
Contributor

jaydoane commented Apr 4, 2020

@iilyak iilyak force-pushed the integrate-emilio branch 2 times, most recently from 97a7c7a to 7a11315 Compare April 15, 2020 10:58
@iilyak iilyak merged commit 7f24add into apache:master Apr 15, 2020
@iilyak iilyak deleted the integrate-emilio branch April 15, 2020 11:36
@iilyak
Copy link
Contributor Author

iilyak commented Apr 15, 2020

@wohali: Thank you for your help with Windows part.

@iilyak iilyak mentioned this pull request Apr 15, 2020
4 tasks
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.

None yet

5 participants