Skip to content

Commit

Permalink
changelog in pack root (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakatzir authored Mar 22, 2020
1 parent dbf459a commit c7b8fe2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

[1]: https://pypi.org/project/demisto-sdk/#history
### 0.4.6
* Added a new command to create the id set - the content dependency tree by file IDs.
* Fixed an issue where the *validate* command did not identify CHANGELOG in packs.
* Added a new command, *id-set* to create the id set - the content dependency tree by file IDs.

### 0.4.5
* generate-docs command:
Expand All @@ -20,7 +21,6 @@
* README files which are html files will now be skipped in the *validate* command.
* Added support for env var: *DEMISTO_README_VALIDATOR*. When not set the readme validation will not run.


### 0.4.4
* Added a validator for IncidentTypes (incidenttype-*.json).
* Fixed an issue where the -p flag in the *validate* command was not working.
Expand Down
1 change: 0 additions & 1 deletion demisto_sdk/commands/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,6 @@ def found_hidden_param(parameter_name):
IGNORED_TYPES_REGEXES = [DESCRIPTION_REGEX, IMAGE_REGEX, PIPFILE_REGEX, SCHEMA_REGEX]

PACKAGE_YML_FILE_REGEX = r'(?:\./)?(?:Packs/[^/]+/)?(?:Integrations|Scripts|Beta_Integrations)/([^\\/]+)/([^\\/]+).yml'
PACKS_YML_FILE_REGEX = r'{}/([^/]+)/(?:{}|{})/([^/]+)/\2\.yml'.format(PACKS_DIR, INTEGRATIONS_DIR, SCRIPTS_DIR)

OLD_YML_FORMAT_FILE = [INTEGRATION_REGEX, SCRIPT_REGEX]

Expand Down
11 changes: 8 additions & 3 deletions demisto_sdk/commands/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import yaml
import requests

from demisto_sdk.commands.common.constants import CHECKED_TYPES_REGEXES, PACKAGE_SUPPORTING_DIRECTORIES,\
CONTENT_GITHUB_LINK, PACKAGE_YML_FILE_REGEX, UNRELEASE_HEADER, RELEASE_NOTES_REGEX, PACKS_DIR, PACKS_DIR_REGEX,\
DEF_DOCKER, DEF_DOCKER_PWSH, TYPE_PWSH, SDK_API_GITHUB_RELEASES
from demisto_sdk.commands.common.constants import CHECKED_TYPES_REGEXES, PACKAGE_SUPPORTING_DIRECTORIES, \
CONTENT_GITHUB_LINK, PACKAGE_YML_FILE_REGEX, UNRELEASE_HEADER, RELEASE_NOTES_REGEX, PACKS_DIR, PACKS_DIR_REGEX, \
DEF_DOCKER, DEF_DOCKER_PWSH, TYPE_PWSH, SDK_API_GITHUB_RELEASES, PACKS_CHANGELOG_REGEX

# disable insecure warnings
urllib3.disable_warnings()
Expand Down Expand Up @@ -306,9 +306,14 @@ def str2bool(v):
def get_release_notes_file_path(file_path):
dir_name = os.path.dirname(file_path)

# CHANGELOG in pack sub dirs
if re.match(PACKAGE_YML_FILE_REGEX, file_path):
return os.path.join(dir_name, 'CHANGELOG.md')

# CHANGELOG in pack root
if re.match(PACKS_CHANGELOG_REGEX, file_path):
return file_path

# outside of packages, change log file will include the original file name.
file_name = os.path.basename(file_path)
return os.path.join(dir_name, os.path.splitext(file_name)[0] + '_CHANGELOG.md')
Expand Down

0 comments on commit c7b8fe2

Please sign in to comment.