Code Monkey home page Code Monkey logo

alexandria's People

Contributors

macgregor avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

alexandria's Issues

tidy up javadoc build

  1. Javadocs are built too many times during the process which slows down the build
  2. Javadoc maven plugin is not properly linking to external classes, including submodules which produces warnings (might have something to do with the classpath being used during

Nice to have: aggregate javadocs into a single site.

Jive throwing 401 sometimes doing search before create

BatchProcessException{message=Alexandria batch error., exceptions=[HttpException{
   message="HttpException: GET https://redacted/api/core/v3/contents?fields=id%2CcontentID%2Ctags%2Cupdated%2Cpublished%2CparentPlace%2Csubject%2Cresources%2Ccontent%2Cvia%2Cparent&filter=tag%2842f4477d-fa30-4729-a721-809fb42b3d1c%29&count=25&startIndex=0 - 401 (excepted one of [20X])",
   rootCauseMessage="HttpException: GET https://redacted/api/core/v3/contents?fields=id%2CcontentID%2Ctags%2Cupdated%2Cpublished%2CparentPlace%2Csubject%2Cresources%2Ccontent%2Cvia%2Cparent&filter=tag%2842f4477d-fa30-4729-a721-809fb42b3d1c%29&count=25&startIndex=0 - 401 (excepted one of [20X])",
   metadata=
{
  "sourcePath" : "redacted/docs/result_message.md",
  "title" : "result_message.md",
  "convertedChecksum" : 3321649118,
  "extraProps" : {
    "jiveTrackingTag" : "42f4477d-fa30-4729-a721-809fb42b3d1c"
  }
}
]}

[ERROR] HttpException: GET https://mojo.redhat.com/api/core/v3/contents?fields=id%2CcontentID%2Ctags%2Cupdated%2Cpublished%2CparentPlace%2Csubject%2Cresources%2Ccontent%2Cvia%2Cparent&filter=tag%2842f4477d-fa30-4729-a721-809fb42b3d1c%29&count=25&startIndex=0 - 401 (excepted one of [20X])
com.github.macgregor.alexandria.exceptions.HttpException: GET https://redacted/api/core/v3/contents?fields=id%2CcontentID%2Ctags%2Cupdated%2Cpublished%2CparentPlace%2Csubject%2Cresources%2Ccontent%2Cvia%2Cparent&filter=tag%2842f4477d-fa30-4729-a721-809fb42b3d1c%29&count=25&startIndex=0 - 401 (excepted one of [20X])
    at com.github.macgregor.alexandria.exceptions.HttpException$Builder.build (HttpException.java:109)
    at com.github.macgregor.alexandria.remotes.RemoteDocument.doRequest (RemoteDocument.java:328)
    at com.github.macgregor.alexandria.remotes.RemoteDocument$RemoteDocumentIterator.nextPage (RemoteDocument.java:478)
    at com.github.macgregor.alexandria.remotes.RemoteDocument$RemoteDocumentIterator.hasNext (RemoteDocument.java:438)
    at com.github.macgregor.alexandria.remotes.RemoteDocument$RemoteDocumentPage.first (RemoteDocument.java:368)
    at com.github.macgregor.alexandria.remotes.jive.JiveRemote.findDocument (JiveRemote.java:300)
    at com.github.macgregor.alexandria.remotes.jive.JiveRemote.create (JiveRemote.java:167)
    at com.github.macgregor.alexandria.AlexandriaSync.lambda$syncWithRemote$1 (AlexandriaSync.java:90)
    at com.github.macgregor.alexandria.BatchProcess.execute (BatchProcess.java:97)
    at com.github.macgregor.alexandria.AlexandriaSync.syncWithRemote (AlexandriaSync.java:77)
    at com.github.macgregor.alexandria.Alexandria.syncWithRemote (Alexandria.java:93)
    at com.github.macgregor.alexandria.SyncMojo.execute (SyncMojo.java:19)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Jive rest api suuuucks. Not sure why this happened, as it cleared up eventually on its own. Possibly a transient error server side, in which case this error is expected, perhaps retries might help if it is a very short lived problem. It could also be a quirk in Jive when a newly created document is in a weird state and the search throws a 401 for some reason when it should be a better error code. I've seen similar errors that I built safeguards for, maybe this is another one.

jive code block rendering is still off

missing line numbers:

<pre class="language-none line-numbers"><code>foo<br />bar&zwj;&zwj;&zwj;&zwj;&zwj;&zwj;<span class="line-numbers-rows"><span>&zwj;</span><span>&zwj;</span></span></code></pre>

language markup is also off. The syntax highlighter in the gui is adding more stlying like:

<code>remote<span class="token punctuation">:</span>  <br />  <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>  <br />metadata<span class="token punctuation">:</span>  <br /><span class="token operator">-</span> sourcePath<span class="token punctuation">:</span> <span class="token string">"docs/images.md"</span> 

Might not be worth trying to get it working perfectly.

Add optional warning to remote doc

Something like "managed by Alexandria changes made here will be overwritten"

Maybe include link to the markdown doc in the source repository.

Support other Jive Content types than Document

jive documents have different types (e.g. document, blog, discussion, etc) and need to be specified. Alexandria currently only supports document types. It could be expanded on without too much effort, but will likely not be supported unless there is interest.

jive - new local file based on existing document throws null pointer exception

When adding a local file to the index that already exists in jive, we get a NPE when sync runs. Its probably not properly finding the content id for some reason

[ERROR] BatchProcessException{message=Alexandria batch error., exceptions=[HttpException{
   message="HttpException: Unexpected error executing PUT",
   rootCauseMessage="NullPointerException: pathSegment == null",
   metadata=
{
  "sourcePath" : "REDACTED/docs/index.md",
  "title" : "Unified Message Bus (UMB) Documentation Index",
  "remoteUri" : "https://REDACTED/docs/DOC-1072237",
  "convertedChecksum" : 3681148503,
  "extraProps" : {
    "jiveParentUri" : "https://REDACTED/groups/REDACTED",
    "jiveParentApiUri" : "https://REDACTED/api/core/v3/places/1508053",
    "jiveParentPlaceId" : "1508053",
    "jiveTrackingTag" : "b3e2f348-6a72-47f5-a7dd-20b4df432157"
  }
}
   request=null
   response=null
}
]}
[ERROR] HttpException: Unexpected error executing PUT
com.github.macgregor.alexandria.exceptions.HttpException: Unexpected error executing PUT
    at com.github.macgregor.alexandria.exceptions.HttpException$Builder.build (HttpException.java:107)
    at com.github.macgregor.alexandria.remotes.RemoteDocument.put (RemoteDocument.java:165)
    at com.github.macgregor.alexandria.remotes.jive.JiveRemote.update (JiveRemote.java:220)
    at com.github.macgregor.alexandria.AlexandriaSync.lambda$syncWithRemote$1 (AlexandriaSync.java:97)
    at com.github.macgregor.alexandria.BatchProcess.execute (BatchProcess.java:97)
    at com.github.macgregor.alexandria.AlexandriaSync.syncWithRemote (AlexandriaSync.java:77)
    at com.github.macgregor.alexandria.Alexandria.syncWithRemote (Alexandria.java:93)
    at com.github.macgregor.alexandria.SyncMojo.execute (SyncMojo.java:19)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.NullPointerException: pathSegment == null
    at okhttp3.HttpUrl$Builder.addPathSegment (HttpUrl.java:1043)
    at com.github.macgregor.alexandria.remotes.Requests.addSegments (Requests.java:72)
    at com.github.macgregor.alexandria.remotes.Requests.routeBuilder (Requests.java:41)
    at com.github.macgregor.alexandria.remotes.RemoteDocument.route (RemoteDocument.java:276)
    at com.github.macgregor.alexandria.remotes.RemoteDocument.put (RemoteDocument.java:152)
    at com.github.macgregor.alexandria.remotes.jive.JiveRemote.update (JiveRemote.java:220)
    at com.github.macgregor.alexandria.AlexandriaSync.lambda$syncWithRemote$1 (AlexandriaSync.java:97)
    at com.github.macgregor.alexandria.BatchProcess.execute (BatchProcess.java:97)
    at com.github.macgregor.alexandria.AlexandriaSync.syncWithRemote (AlexandriaSync.java:77)
    at com.github.macgregor.alexandria.Alexandria.syncWithRemote (Alexandria.java:93)
    at com.github.macgregor.alexandria.SyncMojo.execute (SyncMojo.java:19)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[WARNING]
com.github.macgregor.alexandria.exceptions.BatchProcessException: Alexandria batch error.
    at com.github.macgregor.alexandria.exceptions.BatchProcessException$Builder.build (BatchProcessException.java:63)
    at com.github.macgregor.alexandria.BatchProcess.execute (BatchProcess.java:135)
    at com.github.macgregor.alexandria.AlexandriaSync.syncWithRemote (AlexandriaSync.java:77)
    at com.github.macgregor.alexandria.Alexandria.syncWithRemote (Alexandria.java:93)
    at com.github.macgregor.alexandria.SyncMojo.execute (SyncMojo.java:19)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

maven plugin metadata not quite right

intellij doesnt like configuration section, complains about syntax error. You also have to explicitly set index/convert/sync executions for it to work.

add classes to html renderer for jive

code blocks: class="language-%s line-numbers" in the pre tag, not the code tag which is default
tables:

  • <table class="j-table jiveBorder" style="border: 1px solid #c6c6c6;">
  • header:
<thead>
  <tr style="background-color: #efefef;">
  <th>Tables</th>
  </tr>
</thead>
  • alignment uses style="text-align: center;" instead of "align"

include/exclude glob patterns unintuitive

file system:

projectRoot/
    -> docs/
        -> messages.md
        -> client_provision.md

mojo plugin:

<plugin>
  <groupId>com.github.macgregor</groupId>
  <artifactId>alexandria-maven-plugin</artifactId>
  <version>0.1.4</version>
  <configuration>
    <failBuild>false</failBuild>
    <timeout>60</timeout>
    <includes>
      <include>docs/client_provision.md</include>
      <include>docs/messages.md</include>
    </includes>
  </configuration>
  <executions>
    <execution>
      <id>alexandria</id>
      <goals>
        <goal>index</goal>
        <goal>convert</goal>
        <goal>sync</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Doesnt match though it seems like it should. also tried "**/docs/messages.md", "/**/docs/messages.md", "./docs/messages.md" none of which worked. "**messages.md" worked as did just "messages.md".

Pretty sure the PathFinder is recursively walking the directory tree and only doing matching against file name, which apart from being unintuitive could lead to problems matching multiple files with the same name but in different directories (like README.md's in submodules). It could also have something to do with matching against absolute paths, since all paths are made absolute during processing, but then "**/docs/messages.md" should have worked.

support multiple remotes or pipeline deployments

two use cases here:

  1. two completely different remotes, like Jive and Google docs (or whatever, not suggesting supporting google docs api).
  2. multiple sequential environments of the same type of remote, so pre-prod then prod instances.

This will likely never be implemented unless there is outside interest.

maven plugin throwing null pointer exception for rootDir()

this it has to do with having a parent pom that isnt relative (the parent doesnt have a baseDir because its remote on maven central or wherever).

workaround: manually specify config path and input:

<configuration>
                        <configPath>${basedir}/.alexandria</configPath>
                        <inputs>
                            <input>${basedir}</input>
                        </inputs>
</configuration> 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.