Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Building docs from latest source doesn't work #6702

Closed
draghuram opened this issue Mar 16, 2014 · 15 comments
Closed

Building docs from latest source doesn't work #6702

draghuram opened this issue Mar 16, 2014 · 15 comments

Comments

@draghuram
Copy link

After following the steps outlines on Angular site related to building locally, "grunt package" fails with the following trace:


Error: Invalid configuration. Please provide a valid source.previousVersions property
at module.exports.process (.../angular.js/docs/config/processors/versions-data.js:18:13)
at invoke (.../angular.js/node_modules/dgeni/node_modules/di/lib/injector.js:75:15)
at processingPromise.then.catch.error.message (.../angular.js/node_modules/dgeni/lib/doc-processor.js:117:31)
at _fulfilled (.../angular.js/node_modules/dgeni/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (.../angular.js/node_modules/dgeni/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (.../angular.js/node_modules/dgeni/node_modules/q/q.js:760:13)
at .../angular.js/node_modules/dgeni/node_modules/q/q.js:574:44
at flush (.../angular.js/node_modules/dgeni/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)

Warning: doc generation failed Use --force to continue.

I am only a beginner when it comes to Javascript and Angular but it appears to me that "gitInfo" is not being passed to the function "process()" in "versions-data".

I proceeded by initializing "versions" to some random value (["1.42.1"]) as all I wanted was to get the latest docs.

Thanks,
Raghu

@caitp
Copy link
Contributor

caitp commented Mar 17, 2014

I've just tested this on a fresh clone of Angular, and can't reproduce. Can you provide some more info?

@draghuram
Copy link
Author

I have tried to do a fresh clone and build but "npm install" is choking on
""git://github.com/vojtajina/" as I can't use "git" protocol from work. I
replaced "git" with "https" in package.json as well as
"npm-shrinkwrap.json" but for some reason that failed as well. It appears
as though this link to new git repo is added only today.

I will have to try this at home where I will be able to use "git" protocol.
If possible, I recommend changing the repo URL to use https as "git" is
more restrictive.

@cchungmin
Copy link
Contributor

Also cannot reproduce the issue. I suggest you re-install everything and make sure your system has full privileges to install all dependencies(git, NodeJS, Java, etc)

@draghuram
Copy link
Author

On Mon, Mar 17, 2014 at 9:57 AM, Chung-Min Cheng
notifications@github.comwrote:

Also cannot reproduce the issue. I suggest you re-install everything and
make sure your system has full privileges to install all dependencies(git,
NodeJS, Java, etc)

Sure. Just as FYI, I already have git, java, and node working on this Linux
(CentOS) box. In any case, I will give it another try.

@caitp
Copy link
Contributor

caitp commented Mar 17, 2014

I think the only node package using this is vojta's fork of grunt-jasmine-node.

As a workaround, you should be able to clone the repository manually and npm install <path to your clone>, but this will get tedious after a while

@vojtajina would it make sense to publish this package on npm so that it can be fetched more traditionally?

@IgorMinar IgorMinar self-assigned this Mar 17, 2014
@IgorMinar
Copy link
Contributor

I can't repro this either. Though @btford asked me about something that looked similar. Brian?

@draghuram your issue is different. you need git protocol support in order to fetch the dependencies. git is used by npm to fetch changes that haven't been officially pushed to the npm repo, so without the git protocol you won't be able to install many dependencies.

@draghuram
Copy link
Author

Hi @IgorMinar, the proxy at my work place doesn't allow outgoing "git" protocol connections. Hence my question about using http or https URLs. In any case, I have tried at home where git protocol works. How ever, I still run into the same issue.

@caitp, the output of my build process can be found here:
https://gist.github.com/draghuram/9612899

How ever, considering that no one else is seeing this issue, this must have something to do with my local environment. I will try to figure it out but I did get the local docs working by using the work around I mentioned in original description.

Thanks for all the help.

@draghuram draghuram reopened this Mar 18, 2014
@caitp
Copy link
Contributor

caitp commented Mar 18, 2014

@draghuram I think that issue with docs generation is flaky, I've seen that a few times tonight, but running grunt package again usually works. @petebacondarwin will know more about this, it might be fixable

@petebacondarwin
Copy link
Contributor

I think this may be caused by not having any git tags in your clone. There is a utility that tries to compute the various versions of AngularJS to populate the version chooser drop-down in the docs app, but if you have no tags in your cloned repository this may be breaking. I will see if I can reproduce locally.

@petebacondarwin
Copy link
Contributor

I can't reproduce this by deleting tags. I did the following and it works:

git clone https://github.com/angular/angular.js.git
cd angular.js/
git tag -d `git tag | grep -E '.'`
npm install
grunt package

@petebacondarwin
Copy link
Contributor

Ahah! I think I know what the problem is. We changed the versions utility to look up the tags on the remote git repository to cope with situations where the clone did not pull down all the tags. The line is here: https://github.com/angular/angular.js/blob/master/lib/versions/version-info.js#L107

If your environment is blocking this remote call then this method will return undefined. We should make it more relaxed and return an empty array instead.

@petebacondarwin
Copy link
Contributor

You can easily reproduce this by turning off your internet connection and running grunt package

@IgorMinar
Copy link
Contributor

thanks Pete!

@btford
Copy link
Contributor

btford commented Mar 18, 2014

This is what I was seeing as well. Thanks for the fix, @petebacondarwin!

@draghuram
Copy link
Author

Thanks. It works for me now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants