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

Hardcoded dependency version for model pom.xml #305

Open
aamend opened this issue Oct 22, 2021 · 2 comments
Open

Hardcoded dependency version for model pom.xml #305

aamend opened this issue Oct 22, 2021 · 2 comments

Comments

@aamend
Copy link

aamend commented Oct 22, 2021

Feature Request

Description of Problem:

When packaging legend model to gitlab, we generate a multi module maven project. The project is built using specific legend SDLC and legend engine dependencies where version is hardcoded in the legend SDLC code.

@see: https://github.com/finos/legend-sdlc/blob/master/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/project/ProjectStructureV11Factory.java#L81

@see: https://github.com/finos/legend-sdlc/blob/master/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/project/ProjectStructureV11Factory.java#L87

        private static final String LEGEND_ENGINE_VERSION = "2.37.0";

As a consequence, model built on a specific version of the runtime would not benefit from the latest runtime features at compile time.

Potential Solutions:

Capture the version of dependencies used for SDLC server and inject those exact version to pom.xml generation. This could be done by creating an application.properties file where versions are injected at compile time

legend-sdlc-server/src/main/resources/legend.properties

org.finos.legend.sdlc       ${legend.sdlc.version}
org.finos.legend.engine     ${legend.engine.version}

legend-sdlc-server/pom.xml

        <resources>
            <resource>
                <directory>/</directory>
                <includes>
                    <include>legend.properties</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>

legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/project/ProjectStructureV11Factory.java

protected static String getEngineVersion() throws IOException
    {
        Properties properties = new Properties();
        properties.load(MavenProjectStructure.class.getResourceAsStream("/legend.properties"));
        return properties.getProperty("org.finos.legend.engine");
    }
@MauricioUyaguari
Copy link
Member

MauricioUyaguari commented Dec 24, 2021

Thanks for raising this issue.

Those legend engine/sdlc versions are actually placeholders. We leverage the maven version plugins to replace the legend sdlc/engine version with the latest released version before running the build on a workspace/release.
See https://github.com/finos/legend-sdlc/blob/master/legend-sdlc-server/src/main/resources/org/finos/legend/sdlc/server/gitlab/finos/gitlab-ci-1.yml#L34

If we were to follow your suggestion, we would need to implement a way for users to update to the latest sdlc/engine version, since if a user creates a project at different times they would generate a project with different sdlc/engine versions.

@aamend
Copy link
Author

aamend commented Dec 27, 2021

Thanks! I did not know those were updated at compile time. Makes perfect sense.
The problem I face is that I have a custom legend engine / pure this artifact depends on (see finos/legend-engine#312). Until that PR is approved, I won't be able to get any CI/CD and must manually update version to compile pure model. Any chance you could help with those active PRs?

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

No branches or pull requests

2 participants