Skip to content

Commit

Permalink
Merge branch 'master' into devMaster26Sep
Browse files Browse the repository at this point in the history
  • Loading branch information
rismehta committed Sep 26, 2024
2 parents 839a062 + 22d7cc6 commit f4a01da
Show file tree
Hide file tree
Showing 32 changed files with 560 additions and 58 deletions.
83 changes: 64 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ jobs:
jsdocs-deploy:
docker:
- image: node:8.10.0
working_directory: /home/circleci/build
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -285,19 +286,53 @@ jobs:
# Extract tag from CIRCLE_TAG environment variable
TAG=${CIRCLE_TAG}
# Create the release using GitHub API
RESPONSE=$(curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"$TAG"'",
"name": "'"$TAG"'",
"body": "Release notes for version '"$TAG"'"
}' \
"https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases")
# Maximum number of retries
MAX_RETRIES=3
# Function to create the release using GitHub API
create_release() {
local response
response=$(curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"$TAG"'",
"name": "'"$TAG"'",
"body": "Release notes for version '"$TAG"'"
}' \
"https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases")
echo "$response"
}
# Function to extract upload URL from GitHub API response
extract_upload_url() {
local response="$1"
echo "$response" | jq -r '.upload_url' | sed -e 's/{.*}//'
}
# Create the release with retries
for ((retry_count=1; retry_count<=MAX_RETRIES; retry_count++)); do
echo "Attempt $retry_count to create the release..."
RESPONSE=$(create_release)
echo "RESPONSE: $RESPONSE"
UPLOAD_URL=$(extract_upload_url "$RESPONSE")
echo "UPLOAD_URL: $UPLOAD_URL"
# Check if UPLOAD_URL is not null or empty
if [ -n "$UPLOAD_URL" ] && [ "$UPLOAD_URL" != "null" ]; then
echo "Release successfully created."
break # Successful response, exit the loop
elif [ "$retry_count" -lt "$MAX_RETRIES" ]; then
echo "Failed to create release. Retrying..."
sleep 3 # Add a delay before the next attempt
else
echo "Error: Unable to create release after $MAX_RETRIES attempts."
exit 1
fi
done
# Get the upload URL from the response
UPLOAD_URL=$(echo "$RESPONSE" | jq -r '.upload_url' | sed -e 's/{.*}//')
# Upload release artifacts
for ARTIFACT in ./all/target/*.zip; do
Expand All @@ -318,28 +353,38 @@ jobs:
- run:
name: Update VERSIONS.md and README.md with the new released version
command: |
# Echo Git version
echo "Git Version: $(git --version)"
# Echo Circle CI tag
echo "CIRCLE_TAG: $CIRCLE_TAG"
RELEASE_BRANCH=$(git branch --contains ${CIRCLE_TAG} | awk 'FNR==2 {print $1}')
# Hardcoding the branch on master, since finding branch name with tag does not return correct output
RELEASE_BRANCH="master"
# Debugging output
echo "RELEASE_BRANCH: $RELEASE_BRANCH"
# Checkout branch
git checkout $RELEASE_BRANCH
# Fetch all branches and tags from the remote repository
git fetch --tags
# Retrieve the branch name
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
# Debugging output
echo "BRANCH_NAME: $BRANCH_NAME"
# Find the last two tags on the branch
LAST_TWO_TAGS=$(git tag -l --sort=-v:refname "core-forms-components-reactor-*" | head -n 2)
# Find the last tag on the branch, ignoring the private release
LAST_TAG=$(git tag -l --sort=-v:refname "core-forms-components-reactor-*" | grep -v -- '-[[:alnum:]]*$' | awk -v tag="$CIRCLE_TAG" '$0 < tag' | head -n 1)
# Debugging output
echo "LAST_TWO_TAGS: $LAST_TWO_TAGS"
# echo "LAST_TWO_TAGS: $LAST_TWO_TAGS"
# Extract the last released from the output
LAST_TAG=$(echo "$LAST_TWO_TAGS" | tail -n 1)
# LAST_TAG=$(echo "$LAST_TWO_TAGS" | tail -n 1)
# Debugging output
echo "LAST_TAG: $LAST_TAG"
Expand All @@ -363,13 +408,13 @@ jobs:
# Debugging output
echo "WCM_CORE_COMPONENTS_VERSION: $WCM_CORE_COMPONENTS_VERSION"
echo "Before sed: $(cat VERSIONS.md)"
# echo "Before sed: $(cat VERSIONS.md)"
# update versions.md
sed -i "/$LAST_VERSION/ { p; b; }; 1,/$LAST_VERSION/ { p; d; }" VERSIONS.md
sed -i -E "0,/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+\s*\|/s//| $NEW_VERSION \| $WCM_CORE_COMPONENTS_VERSION |/" VERSIONS.md
echo "After sed: $(cat VERSIONS.md)"
echo "Before sed: $(cat README.md)"
# echo "Before sed: $(cat README.md)"
# update readme.md
sed -i -E "s/(\| $LAST_VERSION\s*\|) [0-9]+\.[0-9]+\.[0-9]+ \s*\| /| $NEW_VERSION | $WCM_CORE_COMPONENTS_VERSION | /g" README.md
echo "After sed: $(cat README.md)"
Expand Down
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ about: Having an issue? Please create a report to explain what it is about.

#### Platform and Version

#### AEM Version (mention the exact version in case of cloud SDK)

#### AEM Forms Version

#### Sample Code that illustrates the problem

#### Logs taken while reproducing problem
#### Logs taken while reproducing problem
1 change: 1 addition & 0 deletions .github/workflows/sync-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
git config --global user.name "ci-build"
- name: Sync with Base Branch
if: ${{ github.event.pull_request.base.ref != 'master' }}
run: |
git fetch origin
git checkout ${{ github.event.pull_request.base.ref }}
Expand Down
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Adobe Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
111 changes: 111 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Contributing

Thank you for choosing to contribute to the Adobe Experience Manager Forms Core Components project, we really appreciate your time and effort! 😃🎊

The following are a set of guidelines for contributing to the project.

#### Contents

* [Code of Conduct](#code-of-conduct)
* [Ways to Contribute](#ways-to-contribute)
* [Reporting and Fixing Bugs](#reporting-and-fixing-bugs-) 🐛
* [Reviewing Code](#reviewing-code-) 👀
* [Documenting](#documenting-) 📜
* [Questions and Enhancement Requests](#questions-and-enhancement-requests-) 💭
* [Contributing Code](#contributing-code-)
* [Issue Report Guidelines](#issue-report-guidelines)
* [Contributor License Agreement](#contributor-license-agreement)

## Code of Conduct

This project adheres to the Adobe [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to the team.

## Ways to Contribute

There are many forms of contributions. New components or features, changes to existing features, tests, documentation, bug fixes, or just good suggestions. For any contribution to be considered, a related [issue](#issue-report-guidelines) is always required.

The Core Component Engineering Team reviews all issues and contributions submitted by the community. During the review we might require clarifications from the contributor. If there is no response from the contributor within two weeks time, the issue will be closed.

Once a contribution is being reviewed, the Core Engineering Team will apply a relevant label to the associated issue. You can see our [label list on GitHub](https://github.com/adobe/aem-core-forms-components/labels) to better understand what each label means.

### Reporting and Fixing Bugs 🐛

#### Before Reporting a Bug
* Have a quick search through the currently open [bug reports](https://github.com/adobe/aem-core-forms-components/labels/bug) to see if the issue has already been reported.
* Ensure that the issue is repeatable and that the actual behavior versus the expected results can be easily described.
* Check that the issue you are experiencing is related to the Core Components project. It may be that the problem derives from AEM itself, typically editor code, rather than the Core Components. If you're not sure, then feel free to report the issue anyway and the committers will clarify for you. Issues in the product can be reported via [Adobe Enterprise Support](https://helpx.adobe.com/contact/enterprise-support.ec.html).

#### Filing a Bug
1. Visit our [issue tracker on GitHub](https://github.com/adobe/aem-core-forms-components/issues).
1. File a `New Issue` as a `Bug Report`.
1. Ensure your issue follows the [issue report guidelines](#issue-report-guidelines).
1. Thanks for the report! The committers will get back to you in a timely manner, typically within one week.

#### Fixing a Bug
If you have a fix ready for a bug, submit a [pull request](#contributing-code-) and reference it in the associated issue.


### Reviewing Code 👀

Reviewing others' code contributions is another great way to contribute - more eyes on the code help to improve its overall quality. To review a pull request, check the [open pull requests](https://github.com/adobe/aem-core-forms-components/pulls) for anything you can comment on.

### Documenting 📜

We very much welcome issue reports or pull requests that improve our documentation pages. While the best effort is made to keep them error free, useful and up-to-date there are always things that could be improved. The component documentation pages (for example the [TextInput Component Documentation](https://github.com/adobe/aem-core-forms-components/tree/master/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/textinput/v1/textinput)), this contributing guide or our [GitHub Wiki](https://github.com/adobe/aem-core-forms-components/wiki) pages are good places to start.

### Questions and Enhancement Requests

You can also add your voice to discussions around new and existing component features by commenting on an RTC. New components and features that openly invite public comment are marked by an [RTC](https://github.com/adobe/aem-core-forms-components/labels/rtc) (Request to Comment) label.

## Contributing Code 👾
High quality code is important to the project, and to keep it that way, all code submissions are reviewed by committers before being accepted. Close adherence to the guidelines below can help speed up the review process and increase the likelihood of the submission being accepted.

### Before Contributing
* Consider [joining developer discussions](#joining-developer-discussions-) to get feedback on what you are thinking of contributing. It's better to get this early feedback before going ahead and potentially having to rewrite everything later.
* Create a [bug report](#reporting-bugs-) or [feature request](#requesting-features-) issue summarizing the problem that you will be solving. This will again help with early feedback and tracking.
* Have a look at our [component checklist](Guidelines.md), for an idea of what certifies a production-ready component.
* Ensure you have [signed the Adobe Contributor License Agreement](http://opensource.adobe.com/cla.html). If you are an Adobe employee, you do not have to sign the CLA.

### Contributing

The project accepts contributions primarily using GitHub pull requests. This process:
* Helps to maintain project quality
* Engages the community in working towards commonly accepted solutions with peer review
* Leads to a more meaningful and cleaner git history
* Ensures sustainable code management

Creating a pull request involves creating a fork of the project in your personal space, adding your new code in a branch and triggering a pull request. Check the GitHub [Using Pull Requests](https://help.github.com/articles/using-pull-requests) article on how to perform pull requests.

Please base your pull request on the `main` branch and make sure to check you have incorporated or merged the latest changes!

The title of the pull request typically matches that of the issue it fixes, see the [issue report guidelines](#issue-report-guidelines).
Have a look at our [pull request template](.github/pull_request_template.md) to see what is expected to be included in the pull request description. The same template is available when the pull request is triggered.

### Your first contribution
Would you like to contribute to the project but don't have an issue in mind? Or are you still fairly unfamiliar with the code? Then have a look at our [good first issues](https://github.com/adobe/aem-core-forms-components/labels/good%20first%20issue), they are fairly simple starter issues that should only require a small amount of code and simple testing.

## Issue Report Guidelines

A well defined issue report will help in quickly understanding and replicating the problem faced, or the feature requested. Below are some guidelines on what to include when reporting an issue. You can also see [this community reported issue](https://github.com/adobe/aem-core-wcm-components/issues/247) for an example of a well written issue report.

##### Title

* **Descriptive** - Should be specific, well described and readable at a glance.
* **Concise** - If the issue can't be easily described in a short title, then it is likely unfocused.
* **Keyword-rich** - Including keywords can help with quickly finding the issue in the backlog. Component related issues can be prefixed with a bracketed label with the component name, for example `[Image]` for the image component.

Bad title: `Search component has security problems`
Good title: `[Search] Fulltext search of pages might lead to DDOS`

##### Description
See our [bug report template](.github/ISSUE_TEMPLATE/BUG_REPORT.md) or [feature request template](.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md) for details on what is expected to be described. The same information is available when creating a new issue on GitHub.

## Contributor License Agreement

By contributing your code to the Adobe Marketing Cloud Github Organisation you grant Adobe a non-exclusive, irrevocable, worldwide, royalty-free, sublicensable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation: (a) open source licenses like the Apache License, Version 2.0; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.

You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contributions.

You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license.

YOU ARE NOT EXPECTED TO PROVIDE SUPPORT FOR YOUR SUBMISSION, UNLESS AND EXCEPT TO THE EXTENT YOU CHOOSE TO DO SO. UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS PROVIDED WITHOUT WARRANTY OF ANY KIND.
Loading

0 comments on commit f4a01da

Please sign in to comment.