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

O3-3511: Content package to create zip file #1

Merged
merged 15 commits into from
Aug 15, 2024

Conversation

nravilla
Copy link
Contributor

@nravilla nravilla commented Jul 18, 2024

Requirements
https://openmrs.atlassian.net/browse/O3-3511

Summary

  1. Updated maven pom.xml to run ContentPropertiesValidator and to create assembly if content.properties are valid.
  2. Created ContentPropertiesValidator, ContentPropertiesValidatorTest, and assembly.xml

To validate and create assembly, run : mvn clean package

@alaboso
Copy link
Contributor

alaboso commented Jul 25, 2024

There is a conflict with pom.xml. @nravilla could you please check it out.

@nravilla
Copy link
Contributor Author

There is a conflict with pom.xml. @nravilla could you please check it out.

Sure Amos, there's been some changes, the java code is moved to another location. will update and resubmit this PR. thank you for checking this out

pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

Thanks @nravilla! I've written up a few small comments on this. Also note that we have conventions for how PRs should appear, i.e., they must reference a ticket, the message should be written in "sentence casing", etc.

assembly.xml Outdated
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/configs</directory>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<directory>${project.basedir}/configs</directory>
<directory>${project.basedir}/configs</directory>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is there a change suggested here?

Copy link
Member

Choose a reason for hiding this comment

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

Removing whitespace

configs/frontend_config/config.json Outdated Show resolved Hide resolved
Comment on lines 16 to 17
spa.frontendModules.@openmrs/esm-login-app=^3.0.0
spa.frontendModules.@openmrs/esm-patient-chart=^1.0.0
Copy link
Member

Choose a reason for hiding this comment

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

Although this is good for demo purposes, I don't think we need this here.

# content.properties - Metadata for the content package and its dependencies

# The name of this content package
name=openmrs-content-hiv
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name=openmrs-content-hiv
name=hiv

Copy link
Member

Choose a reason for hiding this comment

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

Ideally, however, this would be populated from the POM directly:

Suggested change
name=openmrs-content-hiv
name=${project.artifactId}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The above recommended change has been implemented, I don't know much about the data in content.properties, Amos will be responsible for the data. i just have name and version for the time being.

content.properties Outdated Show resolved Hide resolved
pom.xml Outdated
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
Copy link
Member

Choose a reason for hiding this comment

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

We should always use the latest version available, if possible.

Suggested change
<version>3.3.0</version>
<version>3.7.1</version>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

pom.xml Outdated
Comment on lines 65 to 66
<appendAssemblyId>false</appendAssemblyId>
<!-- Ensure this is set to false -->
Copy link
Member

Choose a reason for hiding this comment

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

It'd likely be nice to have a why for this comment, but at least it should go with the right part.

Suggested change
<appendAssemblyId>false</appendAssemblyId>
<!-- Ensure this is set to false -->
<!-- Ensure this is set to false -->
<appendAssemblyId>false</appendAssemblyId>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added a comment, at the top instead of bottom.

pom.xml Outdated
<modelVersion>4.0.0</modelVersion>
<groupId>org.openmrs.content</groupId>
<artifactId>openmrs-content-hiv</artifactId>
<version>1.0-SNAPSHOT</version>
Copy link
Member

Choose a reason for hiding this comment

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

As discussed:

Suggested change
<version>1.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>

pom.xml Outdated
Comment on lines 44 to 46
<goals>
<goal>validate-assemble</goal>
</goals>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<goals>
<goal>validate-assemble</goal>
</goals>
<goals>
<goal>validate-assemble</goal>
</goals>

pom.xml Outdated
<executions>
<execution>
<id>validate-assemble</id>
<phase>package</phase>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<phase>package</phase>
<phase>package</phase>

Copy link
Member

Choose a reason for hiding this comment

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

I also think this should probably be run in the verify phase rather than the package phase. Technically, that comes after the Zip is generated, but in production usage, we're doing to be running the deploy phase to publish this, and that will block that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done! updated it to verify phase instead of package phase.

@nravilla nravilla requested a review from ibacher August 8, 2024 14:18
@ibacher
Copy link
Member

ibacher commented Aug 8, 2024

Could you add the ticket number to the PR title and fix the merge conflicts please? This should be ready to go from there.

@gracepotma
Copy link

Update from @nravilla by email: "I've updated the pom.xml to fetch the 1.8.0 packager-plugin that I released this morning. I also added another execution for validate-configuration as requested, but it's failing. Should we remove it, or can you fix it? It's unrelated to the new plugin I introduced. For now, could you comment out the validate-configuration execution and merge my changes into the main branch? This will complete my task."

@gracepotma gracepotma changed the title validates content.properties and creates a zip file O3-3511: validates content.properties and creates a zip file Aug 13, 2024
@gracepotma
Copy link

Hey @alaboso & @wikumChamith - it would be great if you could help out with reviewing this, if you are available? (Well, re-reviewing, in Amos' case :) ) This PR is turning the repo into the model for future content packages, so it's important to get the whole setup correct - and Ian is very over-booked this week.

@wikumChamith
Copy link
Member

@nravilla can we get the build errors fixed?

@nravilla
Copy link
Contributor Author

nravilla commented Aug 14, 2024

@nravilla can we get the build errors fixed?

Hi Wikum, Ian requested adding another verify step (validate-configurations) and it’s unrelated to my current work. If I comment out that step, the build works fine, please see Grace's message above (email from me)

As asked, to fix build errors, I am commenting that step out for the time being, if Ian really needs it, we can address it as another PR.

@ibacher
Copy link
Member

ibacher commented Aug 14, 2024

@nravilla That step needs to work in CI for the work here to be complete. I realize it's not something you built or changed, but it is validating that the configuration in the package is complete and self-contained which is a required property of content packages.

@nravilla
Copy link
Contributor Author

@nravilla That step needs to work in CI for the work here to be complete. I realize it's not something you built or changed, but it is validating that the configuration in the package is complete and self-contained which is a required property of content packages.

@ibacher, had added that step earlier and i see some issues with it in CI, that's the reason i proposed we deal with it as a separate PR, please see the log at - https://ci.openmrs.org/browse/CH-CON-RTM-4/log

@rbuisson
Copy link

It would be best to skip validation of the actual configuration files for now so to unblock Bamboo and publish the package as is.
In the mean time, @alaboso should be able to fix the configurations so that the OpenMRS validation passes.

@ibacher
Copy link
Member

ibacher commented Aug 15, 2024

@rbuisson It's less configurations that are broken and more the validator itself... I guess we just by-pass this for now.

I've been trying to play around with it, but I can't get the validator to run on my ARM-based Mac, I don't really have a good solution.

@ibacher ibacher changed the title O3-3511: validates content.properties and creates a zip file O3-3511: Content package to create zip file Aug 15, 2024
@ibacher ibacher merged commit ebe07b4 into openmrs:main Aug 15, 2024
1 check passed
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.

7 participants